>>0?1:0),y=o.low=y+P,o.high=g+N+(y>>>0>>0?1:0),b=a.low=b+I,a.high=_+z+(b>>>0>>0?1:0),E=s.low=E+D,s.high=w+T+(E>>>0>>0?1:0),R=u.low=R+H,u.high=S+M+(R>>>0>>0?1:0),k=f.low=k+W,f.high=x+F+(k>>>0>>0?1:0),C=h.low=C+q,h.high=O+U+(C>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(u),e.HmacSHA512=t._createHmacHelper(u)}(),r.SHA512)},4253:function(e,t,n){var r;e.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,o=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=a[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var c=i[o]=[],u=l[o];for(n=0;n<24;n++)c[n/6|0]|=t[(s[n]-1+u)%28]<<31-n%6,c[4+(n/6|0)]|=t[28+(s[n+24]-1+u)%28]<<31-n%6;for(c[0]=c[0]<<1|c[0]>>>31,n=1;n<7;n++)c[n]=c[n]>>>4*(n-1)+3;c[7]=c[7]<<5|c[7]>>>27}var f=this._invSubKeys=[];for(n=0;n<16;n++)f[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+1],h.call(this,4,252645135),h.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),h.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],o=this._lBlock,a=this._rBlock,s=0,l=0;l<8;l++)s|=c[l][((a^i[l])&u[l])>>>0];this._lBlock=a,this._rBlock=o^s}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,h.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=f.createEncryptor(n.create(t)),this._des2=f.createEncryptor(n.create(r)),this._des3=f.createEncryptor(n.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),r.TripleDES)},4938:function(e,t,n){var r,i,o,a,s,l;e.exports=(r=n(8249),o=(i=r).lib,a=o.Base,s=o.WordArray,(l=i.x64={}).Word=a.extend({init:function(e,t){this.high=e,this.low=t}}),l.WordArray=a.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r{var r,i;!function(o,a){"use strict";void 0===(i="function"==typeof(r=a)?r.call(t,n,t,e):r)||(e.exports=i)}(window,(function(){"use strict";var e=function(){var e=window.Element.prototype;if(e.matches)return"matches";if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],n=0;n{var r,i;!function(o,a){r=[n(9741)],i=function(e){return function(e,t){"use strict";var n={extend:function(e,t){for(var n in t)e[n]=t[n];return e},modulo:function(e,t){return(e%t+t)%t}},r=Array.prototype.slice;n.makeArray=function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?r.call(e):[e]},n.removeFrom=function(e,t){var n=e.indexOf(t);-1!=n&&e.splice(n,1)},n.getParent=function(e,n){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,t(e,n))return e},n.getQueryElement=function(e){return"string"==typeof e?document.querySelector(e):e},n.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},n.filterFindElements=function(e,r){e=n.makeArray(e);var i=[];return e.forEach((function(e){if(e instanceof HTMLElement)if(r){t(e,r)&&i.push(e);for(var n=e.querySelectorAll(r),o=0;o{var r,i;window,void 0===(i="function"==typeof(r=function(){"use strict";function e(e){var t=parseFloat(e);return-1==e.indexOf("%")&&!isNaN(t)&&t}var t="undefined"==typeof console?function(){}:function(e){console.error(e)},n=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],r=n.length;function i(e){var n=getComputedStyle(e);return n||t("Style returned "+n+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),n}var o,a=!1;function s(t){if(function(){if(!a){a=!0;var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";var n=document.body||document.documentElement;n.appendChild(t);var r=i(t);o=200==Math.round(e(r.width)),s.isBoxSizeOuter=o,n.removeChild(t)}}(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var l=i(t);if("none"==l.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t{setTimeout((()=>{this.progress(e,t,n)}))};this.images.forEach((function(t){t.once("progress",e),t.check()}))},i.prototype.progress=function(e,t,n){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&r&&r.log(`progress: ${n}`,e,t)},i.prototype.complete=function(){let e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){let e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},s.prototype=Object.create(t.prototype),s.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},s.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},s.prototype.confirm=function(e,t){this.isLoaded=e;let{parentNode:n}=this.img,r="PICTURE"===n.nodeName?n:this.img;this.emitEvent("progress",[this,r,t])},s.prototype.handleEvent=function(e){let t="on"+e.type;this[t]&&this[t](e)},s.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},s.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},s.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},l.prototype=Object.create(s.prototype),l.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},l.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},l.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},i.makeJQueryPlugin=function(t){(t=t||e.jQuery)&&(n=t,n.fn.imagesLoaded=function(e,t){return new i(this,e,t).jqDeferred.promise(n(this))})},i.makeJQueryPlugin(),i}))},8751:(e,t,n)=>{var r,i,o;window,i=[n(1794),n(6131)],void 0===(o="function"==typeof(r=function(e,t){"use strict";var n=e.create("masonry");n.compatOptions.fitWidth="isFitWidth";var r=n.prototype;return r._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var e=0;e1&&n+e>this.cols?0:n;var r=t.size.outerWidth&&t.size.outerHeight;return this.horizontalColIndex=r?n+e:this.horizontalColIndex,{col:n,y:this._getColGroupY(n,e)}},r._manageStamp=function(e){var n=t(e),r=this._getElementOffset(e),i=this._getOption("originLeft")?r.left:r.right,o=i+n.outerWidth,a=Math.floor(i/this.columnWidth);a=Math.max(0,a);var s=Math.floor(o/this.columnWidth);s-=o%this.columnWidth?0:1,s=Math.min(this.cols-1,s);for(var l=(this._getOption("originTop")?r.top:r.bottom)+n.outerHeight,c=a;c<=s;c++)this.colYs[c]=Math.max(l,this.colYs[c])},r._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var e={height:this.maxY};return this._getOption("fitWidth")&&(e.width=this._getContainerFitWidth()),e},r._getContainerFitWidth=function(){for(var e=0,t=this.cols;--t&&0===this.colYs[t];)e++;return(this.cols-e)*this.columnWidth-this.gutter},r.needsResizeLayout=function(){var e=this.containerWidth;return this.getContainerWidth(),e!=this.containerWidth},n})?r.apply(t,i):r)||(e.exports=o)},652:(e,t,n)=>{var r,i,o;window,i=[n(1206),n(6131)],void 0===(o="function"==typeof(r=function(e,t){"use strict";var n=document.documentElement.style,r="string"==typeof n.transition?"transition":"WebkitTransition",i="string"==typeof n.transform?"transform":"WebkitTransform",o={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[r],a={transform:i,transition:r,transitionDuration:r+"Duration",transitionProperty:r+"Property",transitionDelay:r+"Delay"};function s(e,t){e&&(this.element=e,this.layout=t,this.position={x:0,y:0},this._create())}var l=s.prototype=Object.create(e.prototype);l.constructor=s,l._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},l.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},l.getSize=function(){this.size=t(this.element)},l.css=function(e){var t=this.element.style;for(var n in e)t[a[n]||n]=e[n]},l.getPosition=function(){var e=getComputedStyle(this.element),t=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),r=e[t?"left":"right"],i=e[n?"top":"bottom"],o=parseFloat(r),a=parseFloat(i),s=this.layout.size;-1!=r.indexOf("%")&&(o=o/100*s.width),-1!=i.indexOf("%")&&(a=a/100*s.height),o=isNaN(o)?0:o,a=isNaN(a)?0:a,o-=t?s.paddingLeft:s.paddingRight,a-=n?s.paddingTop:s.paddingBottom,this.position.x=o,this.position.y=a},l.layoutPosition=function(){var e=this.layout.size,t={},n=this.layout._getOption("originLeft"),r=this.layout._getOption("originTop"),i=n?"paddingLeft":"paddingRight",o=n?"left":"right",a=n?"right":"left",s=this.position.x+e[i];t[o]=this.getXValue(s),t[a]="";var l=r?"paddingTop":"paddingBottom",c=r?"top":"bottom",u=r?"bottom":"top",f=this.position.y+e[l];t[c]=this.getYValue(f),t[u]="",this.css(t),this.emitEvent("layout",[this])},l.getXValue=function(e){var t=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!t?e/this.layout.size.width*100+"%":e+"px"},l.getYValue=function(e){var t=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&t?e/this.layout.size.height*100+"%":e+"px"},l._transitionTo=function(e,t){this.getPosition();var n=this.position.x,r=this.position.y,i=e==this.position.x&&t==this.position.y;if(this.setPosition(e,t),!i||this.isTransitioning){var o=e-n,a=t-r,s={};s.transform=this.getTranslate(o,a),this.transition({to:s,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},l.getTranslate=function(e,t){return"translate3d("+(e=this.layout._getOption("originLeft")?e:-e)+"px, "+(t=this.layout._getOption("originTop")?t:-t)+"px, 0)"},l.goTo=function(e,t){this.setPosition(e,t),this.layoutPosition()},l.moveTo=l._transitionTo,l.setPosition=function(e,t){this.position.x=parseFloat(e),this.position.y=parseFloat(t)},l._nonTransition=function(e){for(var t in this.css(e.to),e.isCleaning&&this._removeStyles(e.to),e.onTransitionEnd)e.onTransitionEnd[t].call(this)},l.transition=function(e){if(parseFloat(this.layout.options.transitionDuration)){var t=this._transn;for(var n in e.onTransitionEnd)t.onEnd[n]=e.onTransitionEnd[n];for(n in e.to)t.ingProperties[n]=!0,e.isCleaning&&(t.clean[n]=!0);e.from&&(this.css(e.from),this.element.offsetHeight),this.enableTransition(e.to),this.css(e.to),this.isTransitioning=!0}else this._nonTransition(e)};var c="opacity,"+i.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()}));l.enableTransition=function(){if(!this.isTransitioning){var e=this.layout.options.transitionDuration;e="number"==typeof e?e+"ms":e,this.css({transitionProperty:c,transitionDuration:e,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(o,this,!1)}},l.onwebkitTransitionEnd=function(e){this.ontransitionend(e)},l.onotransitionend=function(e){this.ontransitionend(e)};var u={"-webkit-transform":"transform"};l.ontransitionend=function(e){if(e.target===this.element){var t=this._transn,n=u[e.propertyName]||e.propertyName;delete t.ingProperties[n],function(e){for(var t in e)return!1;return!0}(t.ingProperties)&&this.disableTransition(),n in t.clean&&(this.element.style[e.propertyName]="",delete t.clean[n]),n in t.onEnd&&(t.onEnd[n].call(this),delete t.onEnd[n]),this.emitEvent("transitionEnd",[this])}},l.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},l._removeStyles=function(e){var t={};for(var n in e)t[n]="";this.css(t)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return l.removeTransitionStyles=function(){this.css(f)},l.stagger=function(e){e=isNaN(e)?0:e,this.staggerDelay=e+"ms"},l.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},l.remove=function(){r&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",(function(){this.removeElem()})),this.hide()):this.removeElem()},l.reveal=function(){delete this.isHidden,this.css({display:""});var e=this.layout.options,t={};t[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:e.hiddenStyle,to:e.visibleStyle,isCleaning:!0,onTransitionEnd:t})},l.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},l.getHideRevealTransitionEndProperty=function(e){var t=this.layout.options[e];if(t.opacity)return"opacity";for(var n in t)return n},l.hide=function(){this.isHidden=!0,this.css({display:""});var e=this.layout.options,t={};t[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:e.visibleStyle,to:e.hiddenStyle,isCleaning:!0,onTransitionEnd:t})},l.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},l.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},s})?r.apply(t,i):r)||(e.exports=o)},1206:function(e,t,n){var r,i;"undefined"!=typeof window&&window,void 0===(i="function"==typeof(r=function(){"use strict";function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var n=this._events=this._events||{},r=n[e]=n[e]||[];return-1==r.indexOf(t)&&r.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var n=this._onceEvents=this._onceEvents||{};return(n[e]=n[e]||{})[t]=!0,this}},t.off=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){var r=n.indexOf(t);return-1!=r&&n.splice(r,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];for(var r=this._onceEvents&&this._onceEvents[e],i=0;i{var r,i;!function(o,a){"use strict";r=[n(1206),n(6131),n(9047),n(652)],i=function(e,t,n,r){return function(e,t,n,r,i){var o=e.console,a=e.jQuery,s=function(){},l=0,c={};function u(e,t){var n=r.getQueryElement(e);if(n){this.element=n,a&&(this.$element=a(this.element)),this.options=r.extend({},this.constructor.defaults),this.option(t);var i=++l;this.element.outlayerGUID=i,c[i]=this,this._create(),this._getOption("initLayout")&&this.layout()}else o&&o.error("Bad element for "+this.constructor.namespace+": "+(n||e))}u.namespace="outlayer",u.Item=i,u.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=u.prototype;function h(e){function t(){e.apply(this,arguments)}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t}r.extend(f,t.prototype),f.option=function(e){r.extend(this.options,e)},f._getOption=function(e){var t=this.constructor.compatOptions[e];return t&&void 0!==this.options[t]?this.options[t]:this.options[e]},u.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),r.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(e){for(var t=this._filterFindItemElements(e),n=this.constructor.Item,r=[],i=0;i{}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.blockEditor,t=window.wp.blocks,r=window.wp.components,i=window.wp.element,o=window.wp.i18n,a=window.wp.primitives,s=(0,i.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,i.createElement)(a.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"}));function l(){return React.createElement("svg",{width:"80",height:"80",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("title",null,"Instant Images Icon"),React.createElement("path",{d:"M0 8C0 3.58172 3.58172 0 8 0H72C76.4183 0 80 3.58172 80 8V72C80 76.4183 76.4183 80 72 80H8C3.58172 80 0 76.4183 0 72V8Z",fill:"#647FE8"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z",fill:"white"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z",fill:"white"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z",fill:"#C7D2FF"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z",fill:"#C7D2FF"}))}function c(e,t){return function(){return e.apply(t,arguments)}}const{toString:u}=Object.prototype,{getPrototypeOf:f}=Object,h=(d=Object.create(null),e=>{const t=u.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const p=e=>(e=e.toLowerCase(),t=>h(t)===e),m=e=>t=>typeof t===e,{isArray:v}=Array,g=m("undefined"),y=p("ArrayBuffer"),_=m("string"),b=m("function"),w=m("number"),E=e=>null!==e&&"object"==typeof e,S=e=>{if("object"!==h(e))return!1;const t=f(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},R=p("Date"),x=p("File"),k=p("Blob"),O=p("FileList"),C=p("URLSearchParams");function A(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),v(e))for(r=0,i=e.length;r0;)if(r=n[i],t===r.toLowerCase())return r;return null}const j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,L=e=>!g(e)&&e!==j,N=(P="undefined"!=typeof Uint8Array&&f(Uint8Array),e=>P&&e instanceof P);var P;const z=p("HTMLFormElement"),I=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),T=p("RegExp"),D=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},M="abcdefghijklmnopqrstuvwxyz",H="0123456789",F={DIGIT:H,ALPHA:M,ALPHA_DIGIT:M+M.toUpperCase()+H},W={isArray:v,isArrayBuffer:y,isBuffer:function(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||u.call(e)===t||b(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:_,isNumber:w,isBoolean:e=>!0===e||!1===e,isObject:E,isPlainObject:S,isUndefined:g,isDate:R,isFile:x,isBlob:k,isRegExp:T,isFunction:b,isStream:e=>E(e)&&b(e.pipe),isURLSearchParams:C,isTypedArray:N,isFileList:O,forEach:A,merge:function e(){const{caseless:t}=L(this)&&this||{},n={},r=(r,i)=>{const o=t&&B(n,i)||i;S(n[o])&&S(r)?n[o]=e(n[o],r):S(r)?n[o]=e({},r):v(r)?n[o]=r.slice():n[o]=r};for(let e=0,t=arguments.length;e(A(t,((t,r)=>{n&&b(t)?e[r]=c(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&f(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:h,kindOfTest:p,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(v(e))return e;let t=e.length;if(!w(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:z,hasOwnProperty:I,hasOwnProp:I,reduceDescriptors:D,freezeMethods:e=>{D(e,((t,n)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];b(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return v(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:B,global:j,isContextDefined:L,ALPHABET:F,generateString:(e=16,t=F.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(E(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=v(e)?[]:{};return A(e,((e,t)=>{const o=n(e,r+1);!g(o)&&(i[t]=o)})),t[r]=void 0,i}}return e};return n(e,0)}};function U(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}W.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:W.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const q=U.prototype,V={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{V[e]={value:e}})),Object.defineProperties(U,V),Object.defineProperty(q,"isAxiosError",{value:!0}),U.from=(e,t,n,r,i,o)=>{const a=Object.create(q);return W.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const G=U;function J(e){return W.isPlainObject(e)||W.isArray(e)}function Y(e){return W.endsWith(e,"[]")?e.slice(0,-2):e}function K(e,t,n){return e?e.concat(t).map((function(e,t){return e=Y(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const $=W.toFlatObject(W,{},null,(function(e){return/^is[A-Z]/.test(e)})),X=function(e,t,n){if(!W.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=W.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!W.isUndefined(t[e])}))).metaTokens,i=n.visitor||c,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&W.isSpecCompliantForm(t);if(!W.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(W.isDate(e))return e.toISOString();if(!s&&W.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return W.isArrayBuffer(e)||W.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(W.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(W.isArray(e)&&function(e){return W.isArray(e)&&!e.some(J)}(e)||(W.isFileList(e)||W.endsWith(n,"[]"))&&(s=W.toArray(e)))return n=Y(n),s.forEach((function(e,r){!W.isUndefined(e)&&null!==e&&t.append(!0===a?K([n],r,o):null===a?n:n+"[]",l(e))})),!1;return!!J(e)||(t.append(K(i,n,o),l(e)),!1)}const u=[],f=Object.assign($,{defaultVisitor:c,convertValue:l,isVisitable:J});if(!W.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!W.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),W.forEach(n,(function(n,o){!0===(!(W.isUndefined(n)||null===n)&&i.call(t,n,W.isString(o)?o.trim():o,r,f))&&e(n,r?r.concat(o):[o])})),u.pop()}}(e),t};function Z(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Q(e,t){this._pairs=[],e&&X(e,this,t)}const ee=Q.prototype;ee.append=function(e,t){this._pairs.push([e,t])},ee.toString=function(e){const t=e?function(t){return e.call(this,t,Z)}:Z;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const te=Q;function ne(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function re(e,t,n){if(!t)return e;const r=n&&n.encode||ne,i=n&&n.serialize;let o;if(o=i?i(t,n):W.isURLSearchParams(t)?t.toString():new te(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const ie=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){W.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},oe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ae={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:te,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},se=function(e){function t(e,n,r,i){let o=e[i++];const a=Number.isFinite(+o),s=i>=e.length;return o=!o&&W.isArray(r)?r.length:o,s?(W.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&W.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&W.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r{t(function(e){return W.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null},le={"Content-Type":void 0},ce={transitional:oe,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=W.isObject(e);if(i&&W.isHTMLForm(e)&&(e=new FormData(e)),W.isFormData(e))return r&&r?JSON.stringify(se(e)):e;if(W.isArrayBuffer(e)||W.isBuffer(e)||W.isStream(e)||W.isFile(e)||W.isBlob(e))return e;if(W.isArrayBufferView(e))return e.buffer;if(W.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return X(e,new ae.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ae.isNode&&W.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=W.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return X(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(W.isString(e))try{return(0,JSON.parse)(e),W.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ce.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&W.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw G.from(e,G.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ae.classes.FormData,Blob:ae.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};W.forEach(["delete","get","head"],(function(e){ce.headers[e]={}})),W.forEach(["post","put","patch"],(function(e){ce.headers[e]=W.merge(le)}));const ue=ce,fe=W.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),he=Symbol("internals");function de(e){return e&&String(e).trim().toLowerCase()}function pe(e){return!1===e||null==e?e:W.isArray(e)?e.map(pe):String(e)}function me(e,t,n,r,i){return W.isFunction(r)?r.call(this,t,n):(i&&(t=n),W.isString(t)?W.isString(r)?-1!==t.indexOf(r):W.isRegExp(r)?r.test(t):void 0:void 0)}class ve{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=de(t);if(!i)throw new Error("header name must be a non-empty string");const o=W.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=pe(e))}const o=(e,t)=>W.forEach(e,((e,n)=>i(e,n,t)));return W.isPlainObject(e)||e instanceof this.constructor?o(e,t):W.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&fe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=de(e)){const n=W.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(W.isFunction(t))return t.call(this,e,n);if(W.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=de(e)){const n=W.findKey(this,e);return!(!n||void 0===this[n]||t&&!me(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=de(e)){const i=W.findKey(n,e);!i||t&&!me(0,n[i],i,t)||(delete n[i],r=!0)}}return W.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!me(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return W.forEach(this,((r,i)=>{const o=W.findKey(n,i);if(o)return t[o]=pe(r),void delete t[i];const a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete t[i],t[a]=pe(r),n[a]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return W.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&W.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[he]=this[he]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=de(e);t[r]||(function(e,t){const n=W.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return W.isArray(e)?e.forEach(r):r(e),this}}ve.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),W.freezeMethods(ve.prototype),W.freezeMethods(ve);const ge=ve;function ye(e,t){const n=this||ue,r=t||n,i=ge.from(r.headers);let o=r.data;return W.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function _e(e){return!(!e||!e.__CANCEL__)}function be(e,t,n){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,n),this.name="CanceledError"}W.inherits(be,G,{__CANCEL__:!0});const we=be,Ee=ae.isStandardBrowserEnv?{write:function(e,t,n,r,i,o){const a=[];a.push(e+"="+encodeURIComponent(t)),W.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),W.isString(r)&&a.push("path="+r),W.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function Se(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Re=ae.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=W.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},xe=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,a=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),c=r[a];i||(i=l),n[o]=s,r[o]=l;let u=a,f=0;for(;u!==o;)f+=n[u++],u%=e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),l-i{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-n,l=r(s);n=o;const c={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&o<=a?(a-o)/l:void 0,event:i};c[t?"download":"upload"]=!0,e(c)}}const Oe={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=ge.from(e.headers).normalize(),o=e.responseType;let a;function s(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}W.isFormData(r)&&(ae.isStandardBrowserEnv||ae.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let l=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const c=Se(e.baseURL,e.url);function u(){if(!l)return;const r=ge.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new G("Request failed with status code "+n.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:o&&"text"!==o&&"json"!==o?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:e,request:l}),l=null}if(l.open(e.method.toUpperCase(),re(c,e.params,e.paramsSerializer),!0),l.timeout=e.timeout,"onloadend"in l?l.onloadend=u:l.onreadystatechange=function(){l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))&&setTimeout(u)},l.onabort=function(){l&&(n(new G("Request aborted",G.ECONNABORTED,e,l)),l=null)},l.onerror=function(){n(new G("Network Error",G.ERR_NETWORK,e,l)),l=null},l.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||oe;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new G(t,r.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,l)),l=null},ae.isStandardBrowserEnv){const t=(e.withCredentials||Re(c))&&e.xsrfCookieName&&Ee.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in l&&W.forEach(i.toJSON(),(function(e,t){l.setRequestHeader(t,e)})),W.isUndefined(e.withCredentials)||(l.withCredentials=!!e.withCredentials),o&&"json"!==o&&(l.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&l.addEventListener("progress",ke(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",ke(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=t=>{l&&(n(!t||t.type?new we(null,e,l):t),l.abort(),l=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const f=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(c);f&&-1===ae.protocols.indexOf(f)?n(new G("Unsupported protocol "+f+":",G.ERR_BAD_REQUEST,e)):l.send(r||null)}))}};W.forEach(Oe,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ce={getAdapter:e=>{e=W.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;ie instanceof ge?e.toJSON():e;function Le(e,t){t=t||{};const n={};function r(e,t,n){return W.isPlainObject(e)&&W.isPlainObject(t)?W.merge.call({caseless:n},e,t):W.isPlainObject(t)?W.merge({},t):W.isArray(t)?t.slice():t}function i(e,t,n){return W.isUndefined(t)?W.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function o(e,t){if(!W.isUndefined(t))return r(void 0,t)}function a(e,t){return W.isUndefined(t)?W.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>i(je(e),je(t),!0)};return W.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){const o=l[r]||i,a=o(e[r],t[r],r);W.isUndefined(a)&&o!==s||(n[r]=a)})),n}const Ne={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ne[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Pe={};Ne.transitional=function(e,t,n){function r(e,t){return"[Axios v1.3.4] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new G(r(i," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!Pe[i]&&(Pe[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};const ze={assertOptions:function(e,t,n){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const t=e[o],n=void 0===t||a(t,o,e);if(!0!==n)throw new G("option "+o+" must be "+n,G.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new G("Unknown option "+o,G.ERR_BAD_OPTION)}},validators:Ne},Ie=ze.validators;class Te{constructor(e){this.defaults=e,this.interceptors={request:new ie,response:new ie}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Le(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let o;void 0!==n&&ze.assertOptions(n,{silentJSONParsing:Ie.transitional(Ie.boolean),forcedJSONParsing:Ie.transitional(Ie.boolean),clarifyTimeoutError:Ie.transitional(Ie.boolean)},!1),void 0!==r&&ze.assertOptions(r,{encode:Ie.function,serialize:Ie.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),o=i&&W.merge(i.common,i[t.method]),o&&W.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=ge.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,a.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let u,f=0;if(!s){const e=[Be.bind(this),void 0];for(e.unshift.apply(e,a),e.push.apply(e,l),u=e.length,c=Promise.resolve(t);f{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new we(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Me((function(t){e=t})),cancel:e}}}const He=Me,Fe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fe).forEach((([e,t])=>{Fe[t]=e}));const We=Fe,Ue=function e(t){const n=new De(t),r=c(De.prototype.request,n);return W.extend(r,De.prototype,n,{allOwnKeys:!0}),W.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Le(t,n))},r}(ue);Ue.Axios=De,Ue.CanceledError=we,Ue.CancelToken=He,Ue.isCancel=_e,Ue.VERSION="1.3.4",Ue.toFormData=X,Ue.AxiosError=G,Ue.Cancel=Ue.CanceledError,Ue.all=function(e){return Promise.all(e)},Ue.spread=function(e){return function(t){return e.apply(null,t)}},Ue.isAxiosError=function(e){return W.isObject(e)&&!0===e.isAxiosError},Ue.mergeConfig=Le,Ue.AxiosHeaders=ge,Ue.formToJSON=e=>se(W.isHTMLForm(e)?new FormData(e):e),Ue.HttpStatusCode=We,Ue.default=Ue;const qe=Ue;var Ve=n(4184),Ge=n.n(Ve),Je=n(8751),Ye=n.n(Je);const Ke=window.React,$e=new Map,Xe=new WeakMap;let Ze=0;function Qe(e,t,n={},r=undefined){if(void 0===window.IntersectionObserver&&void 0!==r){const i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:o,elements:a}=function(e){let t=function(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(Xe.has(n)||(Ze+=1,Xe.set(n,Ze.toString())),Xe.get(n)):"0"):e[t]}`;var n})).toString()}(e),n=$e.get(t);if(!n){const r=new Map;let i;const o=new IntersectionObserver((t=>{t.forEach((t=>{var n;const o=t.isIntersecting&&i.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=o),null==(n=r.get(t.target))||n.forEach((e=>{e(o,t)}))}))}),e);i=o.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:o,elements:r},$e.set(t,n)}return n}(n);let s=a.get(e)||[];return a.has(e)||a.set(e,s),s.push(t),o.observe(e),function(){s.splice(s.indexOf(t),1),0===s.length&&(a.delete(e),o.unobserve(e)),0===a.size&&(o.disconnect(),$e.delete(i))}}class et extends Ke.Component{constructor(e){super(e),this.node=null,this._unobserveCb=null,this.handleNode=e=>{this.node&&(this.unobserve(),e||this.props.triggerOnce||this.props.skip||this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=e||null,this.observeNode()},this.handleChange=(e,t)=>{e&&this.props.triggerOnce&&this.unobserve(),isPlainChildren(this.props)||this.setState({inView:e,entry:t}),this.props.onChange&&this.props.onChange(e,t)},this.state={inView:!!e.initialInView,entry:void 0}}componentDidUpdate(e){e.rootMargin===this.props.rootMargin&&e.root===this.props.root&&e.threshold===this.props.threshold&&e.skip===this.props.skip&&e.trackVisibility===this.props.trackVisibility&&e.delay===this.props.delay||(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve(),this.node=null}observeNode(){if(!this.node||this.props.skip)return;const{threshold:e,root:t,rootMargin:n,trackVisibility:r,delay:i,fallbackInView:o}=this.props;this._unobserveCb=Qe(this.node,this.handleChange,{threshold:e,root:t,rootMargin:n,trackVisibility:r,delay:i},o)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){if(!isPlainChildren(this.props)){const{inView:e,entry:t}=this.state;return this.props.children({inView:e,entry:t,ref:this.handleNode})}const e=this.props,{children:t,as:n}=e,r=function(e,t){if(null==e)return{};for(var n,r,i={},o=Object.keys(e);r=0||(i[n]=e[n]);return i}(e);return React.createElement(n||"div",_extends({ref:this.handleNode},r),t)}}function tt({threshold:e,delay:t,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:a,initialInView:s,fallbackInView:l,onChange:c}={}){var u;const[f,h]=Ke.useState(null),d=Ke.useRef(),[p,m]=Ke.useState({inView:!!s,entry:void 0});d.current=c,Ke.useEffect((()=>{if(a||!f)return;let s;return s=Qe(f,((e,t)=>{m({inView:e,entry:t}),d.current&&d.current(e,t),t.isIntersecting&&o&&s&&(s(),s=void 0)}),{root:i,rootMargin:r,threshold:e,trackVisibility:n,delay:t},l),()=>{s&&s()}}),[Array.isArray(e)?e.toString():e,f,i,r,o,a,n,l,t]);const v=null==(u=p.entry)?void 0:u.target,g=Ke.useRef();f||!v||o||a||g.current===v||(g.current=v,m({inView:!!s,entry:void 0}));const y=[h,p.inView,p.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}var nt=(0,i.createContext)();function rt(e){var t=e.value,n=e.children;return React.createElement(nt.Provider,{value:t},n)}function it(){return(0,i.useContext)(nt)}function ot(e){return e&&at[e.toLowerCase()].icon?at[e.toLowerCase()].icon():null}var at={proxy:"https://proxy.getinstantimages.com/api/",testmode:!1,defaults:{provider:"unsplash",order:"latest",per_page:"20",arr_key:"results"},providers:["Unsplash","Openverse","Pixabay","Pexels"],unsplash:{name:"Unsplash",requires_key:!0,new:!1,api_var:"client_id",collections_api:"https://api.unsplash.com/collections/",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M10 9V0H22V9H10ZM22 14H32V32H0V14H10V23H22V14Z",fill:"black"}))}},pixabay:{name:"Pixabay",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{clipPath:"url(#clip0_307_143)"},React.createElement("path",{d:"M0 0V32H32V0H0Z",fill:"#48A947"}),React.createElement("path",{d:"M6.83734 22.3147V28C5.93067 28.0427 5.02401 28.032 4.11734 27.9787C4.09601 27.7014 4.06401 27.4667 4.06401 27.2427C4.06401 23.2427 4.05334 19.2534 4.06401 15.2534C4.07467 12.032 5.97334 9.32269 8.85334 8.37335C13.1307 6.95469 17.4507 10.048 17.8453 14.3894C18.144 17.6534 16.4267 20.5547 13.568 21.7814C12.6507 22.176 11.6907 22.304 10.7093 22.304C9.45067 22.3147 8.21334 22.3147 6.83734 22.3147ZM6.84801 19.4454C8.24534 19.4454 9.54667 19.424 10.848 19.4454C13.1627 19.488 14.816 17.76 15.104 15.712C15.424 13.3654 13.7813 11.2107 11.4453 10.88H11.4347C9.25867 10.592 7.06134 12.2774 6.88001 14.528C6.74134 16.128 6.84801 17.728 6.84801 19.4454Z",fill:"#F9FBF9"}),React.createElement("path",{d:"M25.4827 14.9334L30.656 22.2081H27.3067L23.4667 16.9494C22.0694 18.6881 20.9067 20.4907 19.584 22.2081H16.2454L21.408 14.9334L16.8107 8.04272H20.16L23.4454 12.9494L26.7307 8.04272H30.0694L25.4827 14.9334Z",fill:"#FAFCFA"}),React.createElement("path",{d:"M6.848 19.4453C6.848 17.7279 6.74134 16.1173 6.86934 14.5386C7.05067 12.2879 9.248 10.6026 11.424 10.8906C13.7707 11.2106 15.4133 13.3653 15.0933 15.7119C14.816 17.7599 13.152 19.4879 10.8373 19.4453C9.54667 19.4239 8.24534 19.4453 6.848 19.4453Z",fill:"#4AA949"})),React.createElement("defs",null,React.createElement("clipPath",{id:"clip0_307_143"},React.createElement("rect",{width:"32",height:"32",fill:"white"}))))}},pexels:{name:"Pexels",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32px",height:"32px",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z",fill:"#05A081"}),React.createElement("path",{d:"M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z",fill:"#fff"}))}},openverse:{name:"Openverse",requires_key:!1,new:!1,api_var:"key",key:"",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M25.8578 14.32C29.6708 14.32 32.7618 11.1144 32.7618 7.16C32.7618 3.20564 29.6708 0 25.8578 0C22.0448 0 18.9539 3.20564 18.9539 7.16C18.9539 11.1144 22.0448 14.32 25.8578 14.32Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 7.16C0.761841 11.1 3.84742 14.32 7.66584 14.32V0C3.84742 0 0.761841 3.2 0.761841 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 7.16C9.85791 11.1 12.9435 14.32 16.7619 14.32V0C12.9628 0 9.85791 3.2 9.85791 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M25.8578 31.9399C29.6708 31.9399 32.7618 28.7343 32.7618 24.78C32.7618 20.8256 29.6708 17.62 25.8578 17.62C22.0448 17.62 18.9539 20.8256 18.9539 24.78C18.9539 28.7343 22.0448 31.9399 25.8578 31.9399Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 24.7801C9.85791 28.72 12.9435 31.9401 16.7619 31.9401V17.64C12.9628 17.64 9.85791 20.84 9.85791 24.7801Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 24.84C0.761841 28.8 3.84742 32 7.66584 32V17.7C3.84742 17.7 0.761841 20.9 0.761841 24.84Z",fill:"#000000"}))}}},st=[{label:(0,o.__)("WordPress","instant-images"),value:"wordpress"},{label:(0,o.__)("Flickr","instant-images"),value:"flickr"},{label:(0,o.__)("Nasa","instant-images"),value:"nasa"},{label:(0,o.__)("SpaceX","instant-images"),value:"spacex"},{label:(0,o.__)("Wikimedia","instant-images"),value:"wikimedia"}],lt=[{label:(0,o.__)("Square","instant-images"),value:"square"},{label:(0,o.__)("Tall","instant-images"),value:"tall"},{label:(0,o.__)("Wide","instant-images"),value:"wide"}],ct=[{label:(0,o.__)("Red","instant-images"),value:"red"},{label:(0,o.__)("Orange","instant-images"),value:"orange"},{label:(0,o.__)("Yellow","instant-images"),value:"yellow"},{label:(0,o.__)("Green","instant-images"),value:"green"},{label:(0,o.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,o.__)("Blue","instant-images"),value:"blue"},{label:(0,o.__)("Violet","instant-images"),value:"violet"},{label:(0,o.__)("Pink","instant-images"),value:"pink"},{label:(0,o.__)("Brown","instant-images"),value:"brown"},{label:(0,o.__)("Black","instant-images"),value:"black"},{label:(0,o.__)("Gray","instant-images"),value:"gray"},{label:(0,o.__)("White","instant-images"),value:"white"}],ut=[{label:(0,o.__)("Landscape","instant-images"),value:"landscape"},{label:(0,o.__)("Portrait","instant-images"),value:"portrait"},{label:(0,o.__)("Square","instant-images"),value:"squarish"}],ft=[{label:(0,o.__)("Grayscale","instant-images"),value:"grayscale"},{label:(0,o.__)("Red","instant-images"),value:"red"},{label:(0,o.__)("Orange","instant-images"),value:"orange"},{label:(0,o.__)("Yellow","instant-images"),value:"yellow"},{label:(0,o.__)("Green","instant-images"),value:"green"},{label:(0,o.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,o.__)("Blue","instant-images"),value:"blue"},{label:(0,o.__)("Lilac","instant-images"),value:"lilac"},{label:(0,o.__)("Pink","instant-images"),value:"pink"},{label:(0,o.__)("White","instant-images"),value:"white"},{label:(0,o.__)("Gray","instant-images"),value:"gray"},{label:(0,o.__)("Black","instant-images"),value:"black"},{label:(0,o.__)("Brown","instant-images"),value:"brown"},{label:(0,o.__)("Transparent","instant-images"),value:"transparent"}],ht=[{label:(0,o.__)("Backgrounds","instant-images"),value:"backgrounds"},{label:(0,o.__)("Fashion","instant-images"),value:"fashion"},{label:(0,o.__)("Nature","instant-images"),value:"nature"},{label:(0,o.__)("Science","instant-images"),value:"science"},{label:(0,o.__)("Education","instant-images"),value:"education"},{label:(0,o.__)("Feelings","instant-images"),value:"feelings"},{label:(0,o.__)("Health","instant-images"),value:"health"},{label:(0,o.__)("People","instant-images"),value:"people"},{label:(0,o.__)("Religion","instant-images"),value:"religion"},{label:(0,o.__)("Places","instant-images"),value:"places"},{label:(0,o.__)("Animals","instant-images"),value:"animals"},{label:(0,o.__)("Industry","instant-images"),value:"industry"},{label:(0,o.__)("Computer","instant-images"),value:"computer"},{label:(0,o.__)("Food","instant-images"),value:"food"},{label:(0,o.__)("Sports","instant-images"),value:"sports"},{label:(0,o.__)("Food","instant-images"),value:"food"},{label:(0,o.__)("Transportation","instant-images"),value:"transportation"},{label:(0,o.__)("Travel","instant-images"),value:"travel"},{label:(0,o.__)("Buildings","instant-images"),value:"buildings"},{label:(0,o.__)("Business","instant-images"),value:"business"},{label:(0,o.__)("Music","instant-images"),value:"music"}],dt=[{label:(0,o.__)("Horizontal","instant-images"),value:"horizontal"},{label:(0,o.__)("Vertical","instant-images"),value:"vertical"}],pt=[{label:(0,o.__)("Photo","instant-images"),value:"photo"},{label:(0,o.__)("Illustration","instant-images"),value:"illustration"},{label:(0,o.__)("Vector","instant-images"),value:"vector"}],mt=[{label:(0,o.__)("Black & White","instant-images"),value:"black_and_white"},{label:(0,o.__)("Black","instant-images"),value:"black"},{label:(0,o.__)("White","instant-images"),value:"white"},{label:(0,o.__)("Yellow","instant-images"),value:"yellow"},{label:(0,o.__)("Green","instant-images"),value:"green"},{label:(0,o.__)("Orange","instant-images"),value:"orange"},{label:(0,o.__)("Red","instant-images"),value:"red"},{label:(0,o.__)("Purple","instant-images"),value:"purple"},{label:(0,o.__)("Magenta","instant-images"),value:"magenta"},{label:(0,o.__)("Teal","instant-images"),value:"teal"},{label:(0,o.__)("Blue","instant-images"),value:"blue"}],vt=[{label:(0,o.__)("Landscape","instant-images"),value:"landscape"},{label:(0,o.__)("Portrait","instant-images"),value:"portrait"},{label:(0,o.__)("Square","instant-images"),value:"squarish"}];function gt(e){return function(e){if(Array.isArray(e))return yt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return yt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yt(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&parseInt(n)<2&&alert(instant_img_localize.api_ratelimit_msg)}}function Mt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Ht="";function Ft(e){var t=e.currentTarget,n=t.getBoundingClientRect(),r=Math.round(n.left),i=Math.round(n.top),o=t.closest("#photo-listing").querySelector("#tooltip");o.classList.remove("over"),t.classList.contains("tooltip--above")?o.classList.add("above"):o.classList.remove("above"),Ht=setInterval((function(){clearInterval(Ht),o.innerHTML=t.dataset.title,r=r-o.offsetWidth+t.offsetWidth+5,o.style.left="".concat(r,"px"),o.style.top="".concat(i,"px"),setTimeout((function(){o.classList.add("over")}),25)}),750)}function Wt(e){clearInterval(Ht),e.currentTarget.closest("#photo-listing").querySelector("#tooltip").classList.remove("over")}function Ut(e){e&&window&&window.open(e,"_blank")}function qt(){var e=instant_img_localize;switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200){case 400:case 401:return e.api_invalid_msg;case 403:return e.api_invalid_403_msg;case 404:return e.api_invalid_404_msg;case 429:return e.api_ratelimit_msg;case 500:case 503:return e.api_invalid_500_msg;case 501:return e.api_invalid_501_msg}}function Vt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=instant_img_localize,r=qt(t);switch(t){case 400:case 401:case 500:case 429:console.warn("[".concat(n.instant_images," - ").concat(t," Error] ").concat(Mt(e),": ").concat(r))}}function Gt(e){return e&&e[at.defaults.arr_key]||[]}function Jt(e){return void 0===e.total||null===e.total?0:e.total}function Yt(e){if(!e||at.testmode)return!1;var t=sessionStorage.getItem(Tt(e));if(!t)return!1;var n=JSON.parse(t),r=n.expires,i=void 0===r?0:r,o=n.error;if(void 0!==o&&o)return!1;var a=Date.now()>i;return a&&$t(e),!(!n||a)&&n}function Kt(e,t){if(!e||!t||null!=t&&t.error)return!1;t.expires=Date.now()+36e5,sessionStorage.setItem(Tt(e),JSON.stringify(t))}function $t(e){if(!e)return!1;sessionStorage.removeItem(Tt(e))}function Xt(e){return Xt="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},Xt(e)}function Zt(){Zt=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function c(e,t,n,i){var o=t&&t.prototype instanceof h?t:h,a=Object.create(o.prototype),s=new x(i||[]);return r(a,"_invoke",{value:w(e,n,s)}),a}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function h(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==t&&n.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function _(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function i(r,o,a,s){var l=u(e[r],e,o);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==Xt(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(f).then((function(e){c.value=e,a(c)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){i(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function w(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function E(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=u(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,f;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function x(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function k(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function Qt(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function en(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,_x,o,a=[],_n=!0,s=!1;try{if(_x=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;_n=!1}else for(;!(_n=(r=_x.call(n)).done)&&(a.push(r.value),a.length!==t);_n=!0);}catch(e){s=!0,i=e}finally{try{if(!_n&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return tn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=1?null:React.createElement("div",{className:"instant-images-no-results"},React.createElement("div",null,React.createElement("h3",null,instant_img_localize.no_results," "),React.createElement("p",null,instant_img_localize.no_results_desc," ")))}var hn=at.providers;function dn(e){var t=e.switchProvider,n=it().provider;return React.createElement(i.Fragment,null,!(null==hn||!hn.length)&&React.createElement("nav",{className:"provider-nav"},hn.map((function(e,r){return React.createElement("div",{key:"provider-".concat(r)},React.createElement("button",{onClick:function(){return t(e.toLowerCase())},className:n===e.toLowerCase()?"provider-nav--btn active":"provider-nav--btn"},ot(e),React.createElement("span",null,e),at[e.toLowerCase()].new&&React.createElement("span",{className:"provider-nav--new"},instant_img_localize.new)))}))))}function pn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=200&&t.status<400&&JSON.parse(t.response).success||o(!1)},t.onerror=function(e){console.warn(e),o(!1)}}),[]),React.createElement(i.Fragment,null,r?null:React.createElement("div",{className:"error-messaging"},React.createElement("strong",null,instant_img_localize.error_restapi),instant_img_localize.error_restapi_desc))}const vn=window.wp.data;function gn(e,n){var r=e.id,i=void 0===r?null:r,o=e.url,a=void 0===o?null:o,s=e.caption,l=void 0===s?"":s,c=e.alt,u=void 0===c?"":c;if(a&&i){var f=(0,t.createBlock)("core/image",{id:i,url:a,caption:l,alt:u});n?(0,vn.dispatch)("core/block-editor").replaceBlock(n,f):(0,vn.dispatch)("core/block-editor").insertBlocks(f)}}function yn(e){return yn="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},yn(e)}function bn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wn(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&React.createElement("img",{className:"user-wrap--photo",src:j,alt:""}),B)),React.createElement("div",{className:"photo-options"},h&&!Z?React.createElement(i.Fragment,null,React.createElement("button",{type:"button",className:"set-featured fade","data-title":instant_img_localize.set_as_featured,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)},onClick:function(e){return function(e){Wt(e),te.current&&(ie=!0,te.current.click())}(e)}},React.createElement("i",{className:"fa fa-picture-o","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.set_as_featured)),React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)},onClick:function(e){return ae(e)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post))):null,!!l&&React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)},onClick:function(e){return ae(e)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post)),Z?React.createElement("button",{onClick:function(){Z&&(window.location=Z)},className:"edit-photo-admin fade","data-title":instant_img_localize.edit_upload,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)}},React.createElement("i",{className:"fa fa-pencil","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_upload)):React.createElement("button",{onClick:function(e){return function(e){e.preventDefault(),Wt(e);var t=document.querySelectorAll(".edit-screen.editing");t&&t.forEach((function(e){e.classList.remove("editing")})),ne.current.classList.add("editing"),setTimeout((function(){ne.current.focus({preventScroll:!0})}),150)}(e)},className:"edit-photo fade","data-title":instant_img_localize.edit_details,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)}},React.createElement("i",{className:"fa fa-cog","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_details)))),React.createElement("div",{className:"photo-meta"},S?React.createElement("span",{className:"likes tooltip--above","data-title":S+" "+P,onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)}},React.createElement("i",{className:"fa fa-heart heart-like","aria-hidden":"true"})," ",S):null,React.createElement("a",{className:"tooltip--above",href:v,"data-title":"".concat(instant_img_localize.open_external," ").concat(Mt(a)),onMouseEnter:function(e){return Ft(e)},onMouseLeave:function(e){return Wt(e)},rel:"noopener noreferrer",target:"_blank"},React.createElement("i",{className:"fa fa-external-link","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},"".concat(instant_img_localize.open_external," ").concat(Mt(a)))))),React.createElement("div",{className:"edit-screen",tabIndex:"0",ref:ne},React.createElement("div",{className:"edit-screen--title"},React.createElement("div",null,React.createElement("p",{className:"heading"},instant_img_localize.edit_details),R&&R.length>0&&React.createElement("p",{className:"dimensions"},R)),React.createElement("div",{className:"preview",style:{backgroundImage:"url(".concat(O,")")}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_filename,":"),React.createElement("input",{type:"text",name:"filename","data-original":m,placeholder:U.filename,value:U.filename,onChange:function(e){return ce(e)}}),React.createElement("em",null,".",E)),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_title,":"),React.createElement("input",{type:"text",name:"title","data-original":g,placeholder:g,value:U.title||"",onChange:function(e){return ce(e)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_alt,":"),React.createElement("input",{type:"text",name:"alt","data-original":y,value:U.alt||"",onChange:function(e){return ce(e)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_caption,":"),React.createElement("textarea",{rows:"4",name:"caption","data-original":F,onChange:function(e){return ce(e)},value:U.caption||"",ref:re})),H?React.createElement("div",{className:"add-attribution-row"},React.createElement("button",{onClick:function(e){return function(e){e.preventDefault(),re.current.value=H,q(wn(wn({},U),{},{caption:H}))}(e)},type:"button"},instant_img_localize.attribution)):null,React.createElement("div",{className:"edit-screen--controls"},React.createElement("button",{type:"button",className:"button button-secondary",onClick:function(e){return q({filename:m,title:g,alt:y,caption:F}),ne.current.classList.remove("editing"),void te.current.focus({preventScrol:!0})}},instant_img_localize.cancel)," "," ",React.createElement("button",{type:"button",className:"button button-primary",onClick:function(){return ne.current.classList.remove("editing"),void te.current.click()}},l?instant_img_localize.insert_into_post:instant_img_localize.upload_now))),React.createElement("div",{className:"photo-status"})))}function kn(e){var t=e.result.data,n=void 0===t?null:t,r=(null==n?void 0:n.url)||"",o=(null==n?void 0:n.title)||"",a=(null==n?void 0:n.description)||"",s=(null==n?void 0:n.avatar)||"",l=n.image,c=void 0===l?null:l,u=c.src,f=void 0===u?null:u,h=c.alt,d=void 0===h?null:h,p=(0,i.useRef)(),m=(0,i.useRef)();return React.createElement(i.Fragment,null,c&&r?React.createElement("article",{className:"photo feature",title:a,ref:p,onClick:function(){return m.current.click()}},React.createElement("div",{className:"photo--wrap"},React.createElement("span",{className:"flag",title:instant_img_localize.advertisement},instant_img_localize.ad),React.createElement("div",{className:"img-wrap"},React.createElement("a",{className:"loaded",href:r,target:"_blank",ref:m,rel:"noreferrer"},React.createElement("img",{src:f,alt:d}))),React.createElement("div",{className:"feature-title"},s&&React.createElement("img",{src:s,alt:o}),React.createElement("span",null,o)))):null)}function On(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&t.splice(n,1),t.length>=10&&(t.length=10),t.unshift(e),localStorage.setItem(In,JSON.stringify(t))}else localStorage.setItem(In,JSON.stringify([e]))}(r),g(Dn())))}(e)},autoComplete:"off"},React.createElement("label",{htmlFor:"search-input",className:"offscreen"},instant_img_localize.search_label),React.createElement("div",{ref:w},React.createElement("input",{ref:t,type:"text",id:"search-input",placeholder:instant_img_localize.search,disabled:h,onChange:function(e){return c&&p(e.target.value)},onFocus:function(){return b(!0)}}),c&&((null==v?void 0:v.length)||(null==d?void 0:d.length))?React.createElement(Vn,{show:_,history:v,setHistory:g,setSearchValue:function(e){var n=null==t?void 0:t.current;n.value=e,null==E||E.current.click(),n.focus()},container:w}):null,!s&&React.createElement(qn,{show:_})),React.createElement("button",{type:"submit",disabled:h,ref:E},React.createElement("i",{className:"fa fa-search"}),React.createElement("span",{className:"offscreen"},instant_img_localize.search)),React.createElement(Gn,{show:_})))}));function $n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tr(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==h[0]&&h[0],!D){e.next=3;break}return e.abrupt("return",!1);case 3:if(n||""===(null==pe||null===(t=pe.current)||void 0===t?void 0:t.value)){e.next=7;break}if(!v||!y){e.next=7;break}return Oe(pe.current.value),e.abrupt("return");case 7:if(I(!0),d=void 0,(null==pe||null===(d=pe.current)||void 0===d?void 0:d.value)&&(pe.current.value=""),X(w),ee([]),Pe(),ur=1,r=Ot(k,oe),i=Nt("photos",r),!(o=Yt(i))){e.next=18;break}Ae(Gt(o),!1,null),e.next=37;break;case 18:return e.next=20,fetch(i);case 20:return a=e.sent,l=a.status,Dt(a.headers),e.prev=23,e.next=26,a.json();case 26:c=e.sent,u=c.error,f=void 0===u?null:u,Ae(Gt(c),!1,f),Kt(i,c),e.next=37;break;case 32:e.prev=32,e.t0=e.catch(23),Vt(s,l),I(!1),$t(i);case 37:setTimeout((function(){I(!1)}),_);case 38:case"end":return e.stop()}var d}),e,null,[[23,32]])}))),Re.apply(this,arguments)}function xe(){return ke.apply(this,arguments)}function ke(){return(ke=or(Qn().mark((function e(){var t,n,r,i,o,a,l,c,u,f,h,d;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(L&&!z&&!D&&!F){e.next=2;break}return e.abrupt("return");case 2:if(M(!0),ur=parseInt(ur)+1,t=null!=$&&$.active&&null!=$&&$.term?{term:$.term}:{},n=null!=$&&$.active?"search":"photos",r=null!=$&&$.active?le:oe,i=tr(tr(tr({},{page:ur}),t),r),o=Ot(k,i),a=Nt(n,o),!(l=Yt(a))){e.next=15;break}Ae(Gt(l),!0,null),e.next=34;break;case 15:return e.next=17,fetch(a);case 17:return c=e.sent,u=c.status,Dt(c.headers),e.prev=20,e.next=23,c.json();case 23:f=e.sent,h=f.error,d=void 0===h?null:h,Ae(Gt(f),!0,d),Kt(a,f),e.next=34;break;case 29:e.prev=29,e.t0=e.catch(20),Vt(s,u),M(!1),$t(a);case 34:case"end":return e.stop()}}),e,null,[[20,29]])})))).apply(this,arguments)}function Oe(e){return Ce.apply(this,arguments)}function Ce(){return(Ce=or(Qn().mark((function e(t){var n,r,i,o,a,l,c,u,f,h,d;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(I(!0),Pe(),ur=1,n="id:"===t.substring(0,3)?"id":"term",r="id"===n?{id:t.replace("id:","").replace(/\s+/,"")}:{term:t},i=tr(tr(tr({},{page:ur}),r),le),o=Ot(k,i),a=Nt("search",o),!(l=Yt(a))){e.next=14;break}Ae(Gt(l),!1,null),X({active:!0,term:t,type:n,results:Jt(l)}),e.next=35;break;case 14:return e.next=16,fetch(a);case 16:return c=e.sent,u=c.status,Dt(c.headers),e.prev=19,e.next=22,c.json();case 22:f=e.sent,h=f.error,d=void 0===h?null:h,Ae(Gt(f),!1,d),X({active:!0,term:t,type:n,results:Jt(f)}),Kt(a,f),e.next=35;break;case 29:e.prev=29,e.t0=e.catch(19),W(!0),I(!1),Vt(s,u),$t(a);case 35:pe.current.classList.remove(b);case 36:case"end":return e.stop()}}),e,null,[[19,29]])})))).apply(this,arguments)}function Ae(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;e=null==t?void 0:t.length,W(0===parseInt(e)||void 0===e),R(n?function(e){return[].concat(rr(e),rr(t))}:t),V(r)}function Be(e,t){var n=tr({},oe);n[e]&&"#"===t||""===t||"all"===t?delete n[e]:n[e]=t,ae(tr({},n))}function je(e){return Le.apply(this,arguments)}function Le(){return(Le=or(Qn().mark((function e(t){var n,r;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k!==t){e.next=2;break}return e.abrupt("return");case 2:if(I(!0),V(!1),Y(!1),be.classList.remove("overflow-hidden"),!at[t].requires_key||A.includes(t)){e.next=27;break}return e.prev=7,e.next=10,fetch(Pt(t));case 10:if(n=e.sent,r=n.status,Dt(n.headers),200===r){e.next=18;break}return Y(t),V(!0),be.classList.add("overflow-hidden"),e.abrupt("return");case 18:200===r&&B((function(e){return[].concat(rr(e),[t])})),e.next=27;break;case 21:return e.prev=21,e.t0=e.catch(7),Y(t),be.classList.add("overflow-hidden"),V(!0),e.abrupt("return");case 27:setTimeout((function(){re(bt[t].filters),O(t)}),_);case 28:case"end":return e.stop()}}),e,null,[[7,21]])})))).apply(this,arguments)}function Ne(){return(Ne=or(Qn().mark((function e(t){var n;return Qn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&!((null==t?void 0:t.length)<3)){e.next=2;break}return e.abrupt("return");case 2:return n=instant_img_localize.root+"instant-images-extended/suggestions/?term=".concat(t),e.next=5,qe.get(n).then((function(e){ee(e.data)})).catch((function(e){console.warn(e)}));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pe(){ve&&null!=de&&de.current&&(null==de||de.current.scroll({top:0,left:0,behavior:"smooth"}))}function ze(e){if("Escape"===e.key){var t=de.current.querySelectorAll(".edit-screen.editing");t&&rr(t).forEach((function(e){null==e||e.classList.remove("editing")}))}}return(0,i.useEffect)((function(){null!=$&&$.active||ce({})}),[$]),(0,i.useEffect)((function(){L&&null!=$&&$.active&&Oe(null==$?void 0:$.term)}),[le]),(0,i.useEffect)((function(){L&&Se()}),[oe]),(0,i.useEffect)((function(){re(bt[k].filters),ae({})}),[k]),(0,i.useEffect)((function(){xe()}),[he]),(0,i.useEffect)((function(){cr(de.current,(function(){ye||(me.current=new(Ye())(de.current,{itemSelector:".photo"}),de.current.querySelectorAll(".photo").forEach((function(e){e.classList.add("in-view")}))),setTimeout((function(){I(!1),M(!1),L||N(!0)}),_)}))}),[S]),(0,i.useEffect)((function(){return I(!1),Ee.classList.add("loaded"),ye&&Se(),document.addEventListener("keydown",ze,!1),function(){document.removeEventListener("keydown",ze,!1)}}),[]),React.createElement(i.Fragment,null,React.createElement(rt,{value:{provider:k,wpBlock:ve,mediaModal:_e,blockSidebar:ge,clientId:d,search:$,apiError:q,getPhotos:Se,searchHandler:function(e){e.preventDefault();var t=pe.current.value;t.length>2?(pe.current.classList.add(b),Oe(t)):pe.current.focus()},filterSearch:function(e,t){var n=tr({},le);n[e]&&"#"===t||""===t||"all"===t?delete n[e]:n[e]=t,ce(tr({},n))},suggestions:Q,getSuggestions:function(e){return Ne.apply(this,arguments)}}},ve?React.createElement(Et,{switchProvider:je}):React.createElement(React.Fragment,null,React.createElement(dn,{switchProvider:je}),React.createElement(Un,null)),React.createElement(mn,null),React.createElement("div",{className:"control-nav"},React.createElement("div",{className:Ge()("control-nav--filters-wrap",q||null!=$&&$.active?"inactive":null)},ne&&null!==(r=Object.entries(ne))&&void 0!==r&&r.length?React.createElement("div",{className:"control-nav--filters"},Object.entries(ne).map((function(e,t){var n=ar(e,2),r=n[0],i=n[1];return React.createElement(cn,{key:"".concat(k,"-").concat(t,"-").concat(r),data:i,filterKey:r,handler:Be})}))):null),React.createElement(Kn,{ref:pe})),React.createElement("div",{id:"photo-listing",className:z?"loading":null},React.createElement(Xn,null),ve?React.createElement(Nn,{ref:de,data:S,done:F,loadMorePhotos:xe}):React.createElement(Cn,{ref:de,data:S}),React.createElement(fn,{total:null==$?void 0:$.results,is_search:null==$?void 0:$.active}),React.createElement(un,{ref:fe,loadMorePhotos:xe,loading:D,done:F}),React.createElement(nn,{provider:J,callback:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&O(e),Y(!1),I(!1),V(!1),be.classList.remove("overflow-hidden")}}),React.createElement(rn,null),React.createElement(Pn,null))))}const hr=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"connekthq/instant-images","version":"1.0.0","title":"Instant Images","category":"media","description":"One click photo uploads from Unsplash, Openverse, Pixabay and Pexels.","keywords":["image","instant images","photo","stock photos","Unsplash","Openverse","Pixabay","Pexels"],"attributes":{},"supports":{"customClassName":false,"anchor":false,"html":false},"textdomain":"instant-images","editorScript":"file:./index.js"}');function dr(){return React.createElement("div",{style:{width:"300px",padding:"0 10px"}},React.createElement("p",null,React.createElement("strong",null,(0,o.__)("Instant Images Help","instant-images"))),React.createElement("ol",null,React.createElement("li",null,(0,o.__)("Browse photos from the various stock image providers.","instant-images")),React.createElement("li",null,(0,o.__)("Select/click an image to immediately start the upload process.","instant-images")),React.createElement("li",null,(0,o.__)("Uploaded image will be inserted directly into the post using the WordPress core Image block.","instant-images"))))}function pr(e){return pr="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},pr(e)}function mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n array('react', 'wp-blocks', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '29c211701dd89dee583f');
+ array('react', 'wp-blocks', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'fc10c92482e3e4e883e3');
diff --git a/build/instant-images.js b/build/instant-images.js
index 4974362..53c3fc1 100644
--- a/build/instant-images.js
+++ b/build/instant-images.js
@@ -1,19928 +1 @@
-/******/ (() => { // webpackBootstrap
-/******/ var __webpack_modules__ = ({
-
-/***/ "./src/js/common/pluginProvider.js":
-/*!*****************************************!*\
- !*** ./src/js/common/pluginProvider.js ***!
- \*****************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "PluginProvider": () => (/* binding */ PluginProvider),
-/* harmony export */ "usePluginContext": () => (/* binding */ usePluginContext)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-
-
-// Create Context object.
-var PluginContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)();
-
-// Export Provider.
-function PluginProvider(props) {
- var value = props.value,
- children = props.children;
- return /*#__PURE__*/React.createElement(PluginContext.Provider, {
- value: value
- }, children);
-}
-
-// Export useContext Hook.
-function usePluginContext() {
- return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useContext)(PluginContext);
-}
-
-/***/ }),
-
-/***/ "./src/js/components/APILightbox.js":
-/*!******************************************!*\
- !*** ./src/js/components/APILightbox.js ***!
- \******************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ APILightbox)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../functions/buildURL */ "./src/js/functions/buildURL.js");
-/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions/consoleStatus */ "./src/js/functions/consoleStatus.js");
-/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js");
-/* harmony import */ var _functions_updatePluginSetting__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../functions/updatePluginSetting */ "./src/js/functions/updatePluginSetting.js");
-/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js");
-function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
-function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
-function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
-function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
-function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
-function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
-
-
-
-
-
-
-
-/**
- * Render the APILightbox component.
- * Note: Component is display when switching providers and the API is invalid.
- *
- * @param {Object} props The component props.
- * @return {JSX.Element} The APILightbox component.
- */
-function APILightbox(props) {
- var provider = props.provider,
- callback = props.callback;
- var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)("invalid"),
- _useState2 = _slicedToArray(_useState, 2),
- apiStatus = _useState2[0],
- setAPIStatus = _useState2[1];
- var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(""),
- _useState4 = _slicedToArray(_useState3, 2),
- response = _useState4[0],
- setResponse = _useState4[1];
- var lightbox = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var inputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var submitRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var api_key = instant_img_localize["".concat(provider, "_app_id")];
- var title = apiStatus === "invalid" ? instant_img_localize.api_key_invalid : "";
-
- /**
- * Handler for the form submission.
- *
- * @param {Event} e The form event.
- */
- function handleSubmit(_x2) {
- return _handleSubmit.apply(this, arguments);
- }
- /**
- * Close the lightbox
- */
- function _handleSubmit() {
- _handleSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
- var _inputRef$current;
- var key, data, ok, status, headers;
- return _regeneratorRuntime().wrap(function _callee$(_context) {
- while (1) switch (_context.prev = _context.next) {
- case 0:
- e.preventDefault();
- setAPIStatus("loading");
-
- // Get API key value.
- key = inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value; // Set API key to localized variable.
- instant_img_localize["".concat(provider, "_app_id")] = key;
-
- // Update plugin settings via REST API.
- (0,_functions_updatePluginSetting__WEBPACK_IMPORTED_MODULE_5__["default"])("".concat(provider, "_api"), key);
- _context.prev = 5;
- _context.next = 8;
- return fetch((0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_2__.buildTestURL)(provider));
- case 8:
- data = _context.sent;
- // Handle response.
- ok = data.ok, status = data.status, headers = data.headers;
- (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.checkRateLimit)(headers);
-
- // Handle response actions.
- if (ok) {
- // Success.
- setAPIStatus("valid");
- setResponse(instant_img_localize.api_success_msg);
- setTimeout(function () {
- setResponse("");
- setAPIStatus("invalid");
- callback(provider);
- }, 1000);
- } else {
- setAPIStatus("invalid"); // Error/Invalid.
- (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__["default"])(provider, status); // Render console warning.
-
- if (status === 400 || status === 401) {
- setResponse(instant_img_localize.api_invalid_msg); // Unsplash/Pixabay incorrect API key.
- }
-
- if (status === 429) {
- setResponse(instant_img_localize.api_ratelimit_msg); // Pixabay - too many requests.
- }
- }
- _context.next = 19;
- break;
- case 14:
- _context.prev = 14;
- _context.t0 = _context["catch"](5);
- setAPIStatus("invalid"); // Error/Invalid.
- (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_3__["default"])(provider, 500); // Render console warning.
- setResponse(instant_img_localize.api_invalid_500_msg);
- case 19:
- case "end":
- return _context.stop();
- }
- }, _callee, null, [[5, 14]]);
- }));
- return _handleSubmit.apply(this, arguments);
- }
- function closeLightbox() {
- if (lightbox !== null && lightbox !== void 0 && lightbox.current) {
- lightbox.current.classList.remove("active");
- setTimeout(function () {
- callback();
- }, 150);
- }
- }
-
- /**
- * Close the lightbox with a background click.
- *
- * @param {Event} e The form event.
- */
- function bkgClick(e) {
- var target = e.target;
- // If clicked element is the background.
- if (target === (lightbox === null || lightbox === void 0 ? void 0 : lightbox.current)) {
- closeLightbox();
- }
- }
-
- /**
- * Escape handler.
- *
- * @param {Event} e The key press event.
- */
- function escFunction(e) {
- var key = e.key;
- if (key === "Escape") {
- closeLightbox();
- }
- }
-
- /**
- * Reset the key to use Instant Images default.
- */
- function getDefaultKey() {
- inputRef.current.value = "";
- setTimeout(function () {
- submitRef.current.click();
- }, 25);
- }
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- var _lightbox$current;
- document.addEventListener("keydown", escFunction, false);
- lightbox === null || lightbox === void 0 ? void 0 : (_lightbox$current = lightbox.current) === null || _lightbox$current === void 0 ? void 0 : _lightbox$current.classList.add("active");
- return function () {
- document.removeEventListener("keydown", escFunction, false);
- };
- }, [provider]); //eslint-disable-line react-hooks/exhaustive-deps
-
- return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, provider ?
- /*#__PURE__*/
- // eslint-disable-next-line
- React.createElement("div", {
- className: "api-lightbox",
- ref: lightbox,
- onClick: function onClick(e) {
- return bkgClick(e);
- },
- tabIndex: "-1"
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", {
- className: "api-lightbox--close",
- onClick: function onClick() {
- return closeLightbox();
- }
- }, "\xD7", /*#__PURE__*/React.createElement("span", {
- className: "offscreen"
- }, instant_img_localize.btnClose)), /*#__PURE__*/React.createElement("div", {
- className: "api-lightbox--details"
- }, /*#__PURE__*/React.createElement("h3", null, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_6__.getProviderIcon)(provider), provider), /*#__PURE__*/React.createElement("p", null, instant_img_localize["".concat(provider, "_api_desc")]), /*#__PURE__*/React.createElement("p", {
- className: "action-controls"
- }, /*#__PURE__*/React.createElement("button", {
- onClick: function onClick() {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.gotoURL)(instant_img_localize["".concat(provider, "_api_url")]);
- }
- }, instant_img_localize.get_api_key), /*#__PURE__*/React.createElement("span", null, "|"), /*#__PURE__*/React.createElement("button", {
- onClick: function onClick() {
- return getDefaultKey();
- }
- }, instant_img_localize.use_instant_images_key))), /*#__PURE__*/React.createElement("form", {
- onSubmit: function onSubmit(e) {
- return handleSubmit(e);
- }
- }, /*#__PURE__*/React.createElement("label", {
- htmlFor: "key",
- className: "offscreen"
- }, instant_img_localize.enter_api_key), /*#__PURE__*/React.createElement("div", {
- className: "api-lightbox--input-wrap"
- }, /*#__PURE__*/React.createElement("span", {
- className: apiStatus,
- title: title && title
- }, apiStatus === "invalid" && /*#__PURE__*/React.createElement("i", {
- className: "fa fa-exclamation-triangle",
- "aria-hidden": "true"
- }), apiStatus === "valid" && /*#__PURE__*/React.createElement("i", {
- className: "fa fa-check-circle",
- "aria-hidden": "true"
- }), apiStatus === "loading" && /*#__PURE__*/React.createElement("i", {
- className: "fa fa-spinner fa-spin",
- "aria-hidden": "true"
- })), /*#__PURE__*/React.createElement("input", {
- type: "text",
- id: "key",
- ref: inputRef,
- placeholder: "Enter API Key",
- defaultValue: api_key
- })), response && /*#__PURE__*/React.createElement("p", {
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox--response", apiStatus)
- }, response), /*#__PURE__*/React.createElement("button", {
- type: "submit",
- ref: submitRef
- }, instant_img_localize.btnVerify))))) : null);
-}
-
-/***/ }),
-
-/***/ "./src/js/components/ErrorLightbox.js":
-/*!********************************************!*\
- !*** ./src/js/components/ErrorLightbox.js ***!
- \********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ ErrorLightbox)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js");
-/* harmony import */ var _functions_getErrorMessage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions/getErrorMessage */ "./src/js/functions/getErrorMessage.js");
-/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js");
-/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js");
-
-
-
-
-
-
-
-/**
- * Render the ErrorLightbox component.
- * Note: Component is display on initial plugin load if the default provider has an invalid API key.
- *
- * @return {JSX.Element} The ErrorLightbox component.
- */
-function ErrorLightbox() {
- var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(),
- provider = _usePluginContext.provider,
- apiError = _usePluginContext.apiError;
- var lightbox = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var status = apiError !== null && apiError !== void 0 && apiError.status ? apiError.status : null;
- return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, apiError && status && /*#__PURE__*/React.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox", "error-lightbox", "active"),
- ref: lightbox,
- tabIndex: "-1"
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("api-lightbox--details", "error-lightbox")
- }, /*#__PURE__*/React.createElement("h3", null, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_5__.getProviderIcon)(provider), provider), /*#__PURE__*/React.createElement("p", {
- className: "callout-warning"
- }, status, " ", instant_img_localize.error), /*#__PURE__*/React.createElement("p", null, (0,_functions_getErrorMessage__WEBPACK_IMPORTED_MODULE_3__["default"])(status)), /*#__PURE__*/React.createElement("p", {
- className: "more-info"
- }, instant_img_localize.api_default_provider), /*#__PURE__*/React.createElement("p", {
- className: "action-controls"
- }, /*#__PURE__*/React.createElement("button", {
- onClick: function onClick() {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_4__.gotoURL)(instant_img_localize["".concat(provider, "_api_url")]);
- }
- }, instant_img_localize.get_api_key))))));
-}
-
-/***/ }),
-
-/***/ "./src/js/components/Filter.js":
-/*!*************************************!*\
- !*** ./src/js/components/Filter.js ***!
- \*************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Filter)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js");
-/* harmony import */ var _hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hooks/useArrowControls */ "./src/js/hooks/useArrowControls.js");
-function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
-function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
-function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
-
-
-
-
-/**
- * Render the Filter component.
- *
- * @param {Object} props The component props.
- * @param {Object} props.data The filter data.
- * @param {string} props.filterKey The filter key.
- * @param {Function} props.handler The change/click handler function.
- * @return {JSX.Element} The Filter component.
- */
-function Filter(props) {
- var _data$filters;
- var data = props.data,
- filterKey = props.filterKey,
- handler = props.handler;
- var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(),
- provider = _usePluginContext.provider;
- var defaultValue = data === null || data === void 0 ? void 0 : data["default"];
- var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
- _useState2 = _slicedToArray(_useState, 2),
- expanded = _useState2[0],
- setExpanded = _useState2[1];
- var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(defaultValue),
- _useState4 = _slicedToArray(_useState3, 2),
- selected = _useState4[0],
- setSelected = _useState4[1];
- var dropdown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var button = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var menu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var id = "".concat(provider, "-").concat(filterKey);
- var isColor = filterKey === "colors" || filterKey === "color";
-
- // Use up/down arrow keys to navigate dropdown.
- (0,_hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_3__.useArrowControls)(expanded, dropdown);
-
- /**
- * Toggle menu open/closed.
- *
- * @param {Event} event The click event.
- */
- function toggleMenu(event) {
- event.preventDefault();
-
- // If disabled, don't open menu.
- var target = event.currentTarget;
- if (target.disabled) {
- return false;
- }
- if (expanded) {
- setExpanded(false);
- document.removeEventListener("click", closeMenuOutside);
- } else {
- setExpanded(true);
- document.addEventListener("click", closeMenuOutside);
- }
- }
-
- /**
- * Close menu when clicking outside.
- *
- * @param {Event} event The click event.
- */
- function closeMenuOutside(event) {
- var _menu$current, _button$current;
- if (!(menu !== null && menu !== void 0 && (_menu$current = menu.current) !== null && _menu$current !== void 0 && _menu$current.contains(event.target)) && !(button !== null && button !== void 0 && (_button$current = button.current) !== null && _button$current !== void 0 && _button$current.contains(event.target))) {
- setExpanded(false);
- document.removeEventListener("click", closeMenuOutside);
- }
- }
-
- /**
- * Checks for focus outside of component.
- *
- * @param {Event} event The click event.
- */
- function focusOutside(event) {
- if (!(dropdown !== null && dropdown !== void 0 && dropdown.current.contains(event.target))) {
- closeMenuOutside(event);
- }
- }
-
- /**
- * Detect esc key press.
- *
- * @param {Event} event The click event.
- */
- function escClick(event) {
- if (event.key === "Escape") {
- setExpanded(false);
- }
- }
-
- /**
- * Click handler for the filter buttons.
- *
- * @param {string} filter The current filter key.
- * @param {string} value The value to filter.
- */
- function click(filter, value) {
- var newValue = selected !== value ? value : defaultValue;
- setSelected(newValue);
- handler(filter, newValue);
- setTimeout(function () {
- var _button$current2;
- button === null || button === void 0 ? void 0 : (_button$current2 = button.current) === null || _button$current2 === void 0 ? void 0 : _button$current2.click();
- }, 100);
- }
-
- /**
- * Convert a color to a CSS value.
- *
- * @see https://www.w3schools.com/colors/colors_names.asp
- *
- * @param {string} color The current color.
- * @return {string} The color.
- */
- function convertColor(color) {
- if (color === "lilac") {
- color = "DarkViolet";
- }
- if (color === "grayscale" || color === "black_and_white") {
- color = "LightGray";
- }
- return color;
- }
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- // Initiate arrow menus.
- // a11yarrows.init(dropdown?.current, {
- // selector: "button",
- // });
-
- // Check for focus outside.
- document.addEventListener("keyup", focusOutside);
- document.addEventListener("keydown", escClick);
- return function () {
- document.removeEventListener("keyup", focusOutside);
- document.removeEventListener("keydown", escClick);
- };
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
-
- return /*#__PURE__*/React.createElement("div", {
- className: "filter-dropdown",
- id: id,
- ref: dropdown
- }, /*#__PURE__*/React.createElement("button", {
- onClick: toggleMenu,
- className: "filter-dropdown--button",
- "aria-expanded": expanded ? "true" : "false",
- ref: button
- }, /*#__PURE__*/React.createElement("span", {
- className: "filter-dropdown--button-label"
- }, data === null || data === void 0 ? void 0 : data.label), /*#__PURE__*/React.createElement("span", {
- className: "filter-dropdown--button-selected"
- }, selected.replace(/_/g, " "), /*#__PURE__*/React.createElement("i", {
- className: "fa fa-caret-down",
- "aria-hidden": "true"
- }))), /*#__PURE__*/React.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("filter-dropdown--menu", expanded ? "expanded" : null),
- "data-key": filterKey,
- "aria-hidden": expanded ? "false" : "true",
- ref: menu
- }, (data === null || data === void 0 ? void 0 : (_data$filters = data.filters) === null || _data$filters === void 0 ? void 0 : _data$filters.length) && data.filters.map(function (filter, key) {
- var label = filter.label,
- value = filter.value;
- return /*#__PURE__*/React.createElement("button", {
- key: key,
- disabled: selected === value,
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("filter-dropdown--item", selected === value ? "selected" : null),
- onClick: function onClick() {
- return click(filterKey, value);
- }
- }, label, value !== "all" && value !== "transparent" && isColor ? /*#__PURE__*/React.createElement("span", {
- className: "_color",
- style: {
- color: convertColor(value)
- }
- }) : null);
- })));
-}
-
-/***/ }),
-
-/***/ "./src/js/components/Icon.js":
-/*!***********************************!*\
- !*** ./src/js/components/Icon.js ***!
- \***********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "IconLogo": () => (/* binding */ IconLogo),
-/* harmony export */ "IconSVG": () => (/* binding */ IconSVG),
-/* harmony export */ "default": () => (/* binding */ Icon)
-/* harmony export */ });
-/**
- * The Icon component.
- *
- * @return {JSX.Element} The Icon component.
- */
-function Icon() {
- return /*#__PURE__*/React.createElement("span", {
- className: "instant-images-sidebar-icon"
- }, /*#__PURE__*/React.createElement(IconSVG, null));
-}
-
-/**
- * The SVG icon.
- *
- * @return {JSX.Element} The IconSVG component.
- */
-function IconSVG() {
- return /*#__PURE__*/React.createElement("svg", {
- viewBox: "0 0 31 58",
- width: "13px",
- height: "24px"
- }, /*#__PURE__*/React.createElement("polygon", {
- points: "20 0 20 23 31 23 11 58 11 34 0 34 20 0",
- fill: "#4a7bc5"
- }));
-}
-
-/**
- * The SVG Logo.
- *
- * @return {JSX.Element} The IconLogo component.
- */
-function IconLogo() {
- return /*#__PURE__*/React.createElement("svg", {
- width: "80",
- height: "80",
- viewBox: "0 0 80 80",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, /*#__PURE__*/React.createElement("title", null, "Instant Images Icon"), /*#__PURE__*/React.createElement("path", {
- d: "M0 8C0 3.58172 3.58172 0 8 0H72C76.4183 0 80 3.58172 80 8V72C80 76.4183 76.4183 80 72 80H8C3.58172 80 0 76.4183 0 72V8Z",
- fill: "#647FE8"
- }), /*#__PURE__*/React.createElement("path", {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z",
- fill: "white"
- }), /*#__PURE__*/React.createElement("path", {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "M36.5 65L52.5 36.5816H44.4385V16.1215L27 44.0693H36.5V65Z",
- fill: "white"
- }), /*#__PURE__*/React.createElement("path", {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z",
- fill: "#C7D2FF"
- }), /*#__PURE__*/React.createElement("path", {
- fillRule: "evenodd",
- clipRule: "evenodd",
- d: "M36.5 65L52.5 36.5817H44.4385L36.5 44.0693V65Z",
- fill: "#C7D2FF"
- }));
-}
-
-/***/ }),
-
-/***/ "./src/js/components/InstantImages.js":
-/*!********************************************!*\
- !*** ./src/js/components/InstantImages.js ***!
- \********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ InstantImages)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! masonry-layout */ "./node_modules/masonry-layout/masonry.js");
-/* harmony import */ var masonry_layout__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(masonry_layout__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! react-intersection-observer */ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs");
-/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js");
-/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js");
-/* harmony import */ var _constants_filters__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants/filters */ "./src/js/constants/filters.js");
-/* harmony import */ var _editor_block_components_Header__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../editor/block/components/Header */ "./src/js/editor/block/components/Header.js");
-/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../functions/buildURL */ "./src/js/functions/buildURL.js");
-/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../functions/consoleStatus */ "./src/js/functions/consoleStatus.js");
-/* harmony import */ var _functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../functions/getQueryParams */ "./src/js/functions/getQueryParams.js");
-/* harmony import */ var _functions_getResults__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../functions/getResults */ "./src/js/functions/getResults.js");
-/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js");
-/* harmony import */ var _functions_session__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../functions/session */ "./src/js/functions/session.js");
-/* harmony import */ var _APILightbox__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./APILightbox */ "./src/js/components/APILightbox.js");
-/* harmony import */ var _ErrorLightbox__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ErrorLightbox */ "./src/js/components/ErrorLightbox.js");
-/* harmony import */ var _Filter__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Filter */ "./src/js/components/Filter.js");
-/* harmony import */ var _LoadMore__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./LoadMore */ "./src/js/components/LoadMore.js");
-/* harmony import */ var _NoResults__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./NoResults */ "./src/js/components/NoResults.js");
-/* harmony import */ var _ProviderNav__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./ProviderNav */ "./src/js/components/ProviderNav.js");
-/* harmony import */ var _RestAPIError__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./RestAPIError */ "./src/js/components/RestAPIError.js");
-/* harmony import */ var _Results__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Results */ "./src/js/components/Results.js");
-/* harmony import */ var _ResultsWPBlock__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./ResultsWPBlock */ "./src/js/components/ResultsWPBlock.js");
-/* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Tooltip */ "./src/js/components/Tooltip.js");
-/* harmony import */ var _cta_Extended__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./cta/Extended */ "./src/js/components/cta/Extended.js");
-/* harmony import */ var _search_SearchForm__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./search/SearchForm */ "./src/js/components/search/SearchForm.js");
-/* harmony import */ var _search_SearchHeader__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./search/SearchHeader */ "./src/js/components/search/SearchHeader.js");
-function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
-function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
-function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
-function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
-function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
-function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
-function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
-function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
-function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
-function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
-function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-var imagesLoaded = __webpack_require__(/*! imagesloaded */ "./node_modules/imagesloaded/imagesloaded.js");
-var page = 1;
-
-/**
- * Render the main InstantImages application component.
- *
- * @param {Object} props The component props.
- * @param {string} props.editor Editor type.
- * @param {string} props.provider Image provider.
- * @param {Array} props.data API results.
- * @param {Element} props.container Instant Images container element.
- * @param {Object} props.api_error API error object.
- * @param {string} props.clientId WP block client ID.
- * @return {JSX.Element} InstantImages component.
- */
-function InstantImages(props) {
- var _instant_img_localize4, _instant_img_localize5, _Object$entries;
- var _props$editor = props.editor,
- editor = _props$editor === void 0 ? "classic" : _props$editor,
- provider = props.provider,
- data = props.data,
- container = props.container,
- _props$api_error = props.api_error,
- api_error = _props$api_error === void 0 ? null : _props$api_error,
- _props$clientId = props.clientId,
- clientId = _props$clientId === void 0 ? null : _props$clientId;
- var _instant_img_localize = (_instant_img_localize4 = instant_img_localize) === null || _instant_img_localize4 === void 0 ? void 0 : (_instant_img_localize5 = _instant_img_localize4.addons) === null || _instant_img_localize5 === void 0 ? void 0 : _instant_img_localize5.extended,
- _instant_img_localize2 = _instant_img_localize.activated,
- extended_activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2,
- _instant_img_localize3 = _instant_img_localize.license,
- extended_license = _instant_img_localize3 === void 0 ? false : _instant_img_localize3;
- var delay = 250;
- var searchClass = "searching";
- var searchDefaults = {
- active: false,
- term: "",
- type: "",
- results: 0
- };
-
- // App state.
- var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(data)),
- _useState2 = _slicedToArray(_useState, 2),
- results = _useState2[0],
- setResults = _useState2[1]; // Image results.
- var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(provider),
- _useState4 = _slicedToArray(_useState3, 2),
- activeProvider = _useState4[0],
- setActiveProvider = _useState4[1]; // Current provider.
- var _useState5 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
- _useState6 = _slicedToArray(_useState5, 2),
- apiTested = _useState6[0],
- setAPITested = _useState6[1]; // API key test results.
- var _useState7 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
- _useState8 = _slicedToArray(_useState7, 2),
- mounted = _useState8[0],
- setMounted = _useState8[1]; // App mounted state.
- var _useState9 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true),
- _useState10 = _slicedToArray(_useState9, 2),
- loading = _useState10[0],
- setLoading = _useState10[1]; // Loading state
- var _useState11 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
- _useState12 = _slicedToArray(_useState11, 2),
- loadingMore = _useState12[0],
- setLoadingMore = _useState12[1]; // Load more state.
- var _useState13 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
- _useState14 = _slicedToArray(_useState13, 2),
- done = _useState14[0],
- setDone = _useState14[1]; // Done state.
- var _useState15 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(api_error),
- _useState16 = _slicedToArray(_useState15, 2),
- apiError = _useState16[0],
- setAPIError = _useState16[1]; // API Error.
- var _useState17 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
- _useState18 = _slicedToArray(_useState17, 2),
- showAPILightbox = _useState18[0],
- setShowAPILightbox = _useState18[1]; // Render API key lightbox.
- var _useState19 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(searchDefaults),
- _useState20 = _slicedToArray(_useState19, 2),
- search = _useState20[0],
- setSearch = _useState20[1];
- var _useState21 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
- _useState22 = _slicedToArray(_useState21, 2),
- suggestions = _useState22[0],
- setSuggestions = _useState22[1];
- var _useState23 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[activeProvider].filters),
- _useState24 = _slicedToArray(_useState23, 2),
- filterOptions = _useState24[0],
- setFilterOptions = _useState24[1];
- var _useState25 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}),
- _useState26 = _slicedToArray(_useState25, 2),
- filters = _useState26[0],
- setFilters = _useState26[1];
- var _useState27 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({}),
- _useState28 = _slicedToArray(_useState27, 2),
- searchFilters = _useState28[0],
- setSearchFilters = _useState28[1];
-
- // Refs.
- var _useInView = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_26__.useInView)({
- rootMargin: "0px 0px"
- }),
- _useInView2 = _slicedToArray(_useInView, 2),
- loadMoreRef = _useInView2[0],
- inView = _useInView2[1];
- var photosRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var searchInputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var msnryRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
-
- // WP Editor props.
- var wpBlock = editor === "block" ? true : false;
- var blockSidebar = editor === "sidebar" ? true : false;
- var isBlockEditor = wpBlock || blockSidebar ? true : false;
- var mediaModal = editor === "media-modal" ? true : false;
- var body = document.body;
- var plugin = isBlockEditor ? container : container.parentNode.parentNode;
- var wrapper = isBlockEditor ? container : plugin.querySelector(".instant-images-wrapper");
-
- /**
- * Get the initial set of photos for the current view (New/Popular/Filters/etc...).
- *
- * @param {boolean} reset Reset the current view.
- * @since 3.0
- */
- function getPhotos() {
- return _getPhotos.apply(this, arguments);
- }
- /**
- * Load more photos in infinite scroll style.
- *
- * @since 3.0
- */
- function _getPhotos() {
- _getPhotos = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
- var _searchInputRef$curre2;
- var reset,
- params,
- url,
- sessionData,
- response,
- status,
- headers,
- apiResults,
- _apiResults$error,
- error,
- _args = arguments;
- return _regeneratorRuntime().wrap(function _callee$(_context) {
- while (1) switch (_context.prev = _context.next) {
- case 0:
- reset = _args.length > 0 && _args[0] !== undefined ? _args[0] : false;
- if (!loadingMore) {
- _context.next = 3;
- break;
- }
- return _context.abrupt("return", false);
- case 3:
- if (!(!reset && (searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre2 = searchInputRef.current) === null || _searchInputRef$curre2 === void 0 ? void 0 : _searchInputRef$curre2.value) !== "")) {
- _context.next = 7;
- break;
- }
- if (!(extended_activated && extended_license)) {
- _context.next = 7;
- break;
- }
- doSearch(searchInputRef.current.value);
- return _context.abrupt("return");
- case 7:
- setLoading(true); // Set loading state.
- clearSearch(); // Reset search results.
-
- resetScrollPosition();
- page = 1;
-
- // Build URL.
- params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, filters);
- url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])("photos", params); // Get session storage.
- sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url);
- if (!sessionData) {
- _context.next = 18;
- break;
- }
- // Display results from session.
- displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), false, null);
- _context.next = 37;
- break;
- case 18:
- _context.next = 20;
- return fetch(url);
- case 20:
- response = _context.sent;
- status = response.status, headers = response.headers;
- (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers);
- _context.prev = 23;
- _context.next = 26;
- return response.json();
- case 26:
- apiResults = _context.sent;
- _apiResults$error = apiResults.error, error = _apiResults$error === void 0 ? null : _apiResults$error;
- displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), false, error);
- (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults);
- _context.next = 37;
- break;
- case 32:
- _context.prev = 32;
- _context.t0 = _context["catch"](23);
- (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status);
- setLoading(false);
- (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url);
- case 37:
- // Delay loading animatons for effect.
- setTimeout(function () {
- setLoading(false);
- }, delay);
- case 38:
- case "end":
- return _context.stop();
- }
- }, _callee, null, [[23, 32]]);
- }));
- return _getPhotos.apply(this, arguments);
- }
- function loadMorePhotos() {
- return _loadMorePhotos.apply(this, arguments);
- }
- /**
- * Perform a photo search.
- *
- * @param {string} term Search term.
- * @since 3.0
- */
- function _loadMorePhotos() {
- _loadMorePhotos = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
- var searchQuery, type, activeFilters, loadmoreParams, params, url, sessionData, response, status, headers, apiResults, _apiResults$error2, error;
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
- while (1) switch (_context2.prev = _context2.next) {
- case 0:
- if (!(!mounted || loading || loadingMore || done)) {
- _context2.next = 2;
- break;
- }
- return _context2.abrupt("return");
- case 2:
- setLoadingMore(true);
- page = parseInt(page) + 1;
-
- // Get search query.
- searchQuery = search !== null && search !== void 0 && search.active && search !== null && search !== void 0 && search.term ? {
- term: search.term
- } : {}; // Build URL.
- type = search !== null && search !== void 0 && search.active ? "search" : "photos";
- activeFilters = search !== null && search !== void 0 && search.active ? searchFilters : filters;
- loadmoreParams = _objectSpread(_objectSpread(_objectSpread({}, {
- page: page
- }), searchQuery), activeFilters);
- params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, loadmoreParams);
- url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])(type, params); // Get session storage.
- sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url);
- if (!sessionData) {
- _context2.next = 15;
- break;
- }
- // Display results from session.
- displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), true, null);
- _context2.next = 34;
- break;
- case 15:
- _context2.next = 17;
- return fetch(url);
- case 17:
- response = _context2.sent;
- status = response.status, headers = response.headers;
- (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers);
- _context2.prev = 20;
- _context2.next = 23;
- return response.json();
- case 23:
- apiResults = _context2.sent;
- _apiResults$error2 = apiResults.error, error = _apiResults$error2 === void 0 ? null : _apiResults$error2;
- displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), true, error);
- (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults);
- _context2.next = 34;
- break;
- case 29:
- _context2.prev = 29;
- _context2.t0 = _context2["catch"](20);
- (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status);
- setLoadingMore(false);
- (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url);
- case 34:
- case "end":
- return _context2.stop();
- }
- }, _callee2, null, [[20, 29]]);
- }));
- return _loadMorePhotos.apply(this, arguments);
- }
- function doSearch(_x2) {
- return _doSearch.apply(this, arguments);
- }
- /**
- * Handle the display results.
- *
- * @param {Array} images Image array.
- * @param {boolean} append Append images to existing results display.
- * @param {string|null} error Error message.
- */
- function _doSearch() {
- _doSearch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(term) {
- var searchType, searchQuery, searchParams, params, url, sessionData, response, status, headers, apiResults, _apiResults$error3, error;
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
- while (1) switch (_context3.prev = _context3.next) {
- case 0:
- setLoading(true);
- resetScrollPosition();
- page = 1; // Reset current page num.
- searchType = term.substring(0, 3) === "id:" ? "id" : "term"; // Get search query.
- searchQuery = searchType === "id" ? {
- id: term.replace("id:", "").replace(/\s+/, "")
- } : {
- term: term
- }; // Build URL.
- searchParams = _objectSpread(_objectSpread(_objectSpread({}, {
- page: page
- }), searchQuery), searchFilters);
- params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_9__["default"])(activeProvider, searchParams);
- url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__["default"])("search", params); // Get session storage.
- sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.getSession)(url);
- if (!sessionData) {
- _context3.next = 14;
- break;
- }
- // Display results from session.
- displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(sessionData), false, null);
- setSearch({
- active: true,
- term: term,
- type: searchType,
- results: (0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__.getSearchTotal)(sessionData)
- });
- _context3.next = 35;
- break;
- case 14:
- _context3.next = 16;
- return fetch(url);
- case 16:
- response = _context3.sent;
- status = response.status, headers = response.headers;
- (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers);
- _context3.prev = 19;
- _context3.next = 22;
- return response.json();
- case 22:
- apiResults = _context3.sent;
- _apiResults$error3 = apiResults.error, error = _apiResults$error3 === void 0 ? null : _apiResults$error3;
- displayResults((0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__["default"])(apiResults), false, error);
- setSearch({
- active: true,
- term: term,
- type: searchType,
- results: (0,_functions_getResults__WEBPACK_IMPORTED_MODULE_10__.getSearchTotal)(apiResults)
- });
- (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.saveSession)(url, apiResults);
- _context3.next = 35;
- break;
- case 29:
- _context3.prev = 29;
- _context3.t0 = _context3["catch"](19);
- // Reset all search parameters.
- setDone(true);
- setLoading(false);
- (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_8__["default"])(provider, status);
- (0,_functions_session__WEBPACK_IMPORTED_MODULE_12__.deleteSession)(url);
- case 35:
- searchInputRef.current.classList.remove(searchClass);
- case 36:
- case "end":
- return _context3.stop();
- }
- }, _callee3, null, [[19, 29]]);
- }));
- return _doSearch.apply(this, arguments);
- }
- function displayResults() {
- var images = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
- var append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
- var error = arguments.length > 2 ? arguments[2] : undefined;
- checkResults(images === null || images === void 0 ? void 0 : images.length);
- if (append) {
- setResults(function (prevState) {
- return [].concat(_toConsumableArray(prevState), _toConsumableArray(images));
- }); // Load more.
- } else {
- setResults(images); // Standard switch.
- }
-
- setAPIError(error);
- }
-
- /**
- * Handle the Photo Search.
- *
- * @param {Event} event The dispatched submit event.
- * @since 3.0
- */
- function searchHandler(event) {
- event.preventDefault();
- var term = searchInputRef.current.value;
- if (term.length > 2) {
- searchInputRef.current.classList.add(searchClass);
- doSearch(term);
- } else {
- searchInputRef.current.focus();
- }
- }
-
- /**
- * Reset search results, settings and results view.
- *
- * @since 3.0
- */
- function clearSearch() {
- var _searchInputRef$curre;
- var term = (searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.value) || "";
- if (term) {
- searchInputRef.current.value = "";
- }
- setSearch(searchDefaults);
- setSuggestions([]);
- }
-
- /**
- * Filter the photo listing.
- *
- * @param {string} filter The current filter key.
- * @param {string} value The value to filter.
- */
- function filterPhotos(filter, value) {
- var newFilters = _objectSpread({}, filters);
- if (newFilters[filter] && value === "#" || value === "" || value === "all") {
- delete newFilters[filter];
- } else {
- newFilters[filter] = value;
- }
- setFilters(_objectSpread({}, newFilters));
- }
-
- /**
- * Filter the search results.
- *
- * @param {string} filter The current filter key.
- * @param {string} value The value to filter.
- */
- function filterSearch(filter, value) {
- var newSearchFilters = _objectSpread({}, searchFilters);
- if (newSearchFilters[filter] && value === "#" || value === "" || value === "all") {
- delete newSearchFilters[filter];
- } else {
- newSearchFilters[filter] = value;
- }
- setSearchFilters(_objectSpread({}, newSearchFilters));
- }
-
- /**
- * Close the API Lightbox.
- *
- * @param {string} target The target provider to close the lightbox for.
- * @since 4.5
- */
- function closeAPILightbox() {
- var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
- if (target) {
- setActiveProvider(target);
- }
- setShowAPILightbox(false);
- setLoading(false);
- setAPIError(false);
- body.classList.remove("overflow-hidden");
- }
-
- /**
- * Switch API providers.
- *
- * @param {string} newProvider The provider to switch to.
- * @since 4.5
- */
- function switchProvider(_x3) {
- return _switchProvider.apply(this, arguments);
- }
- /**
- * Get autocomplete search suggestions.
- *
- * @param {string} term The search term.
- * @return {Array} The autocomplete suggestions.
- */
- function _switchProvider() {
- _switchProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(newProvider) {
- var response, status, headers;
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
- while (1) switch (_context4.prev = _context4.next) {
- case 0:
- if (!(activeProvider === newProvider)) {
- _context4.next = 2;
- break;
- }
- return _context4.abrupt("return");
- case 2:
- setLoading(true);
- setAPIError(false);
- setShowAPILightbox(false);
- body.classList.remove("overflow-hidden");
-
- // API verification - check API key for provider.
- if (!(_constants_API__WEBPACK_IMPORTED_MODULE_4__.API[newProvider].requires_key && !apiTested.includes(newProvider))) {
- _context4.next = 27;
- break;
- }
- _context4.prev = 7;
- _context4.next = 10;
- return fetch((0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_7__.buildTestURL)(newProvider));
- case 10:
- response = _context4.sent;
- status = response.status, headers = response.headers;
- (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_11__.checkRateLimit)(headers);
- if (!(status !== 200)) {
- _context4.next = 18;
- break;
- }
- // Catch API errors and 401s.
- setShowAPILightbox(newProvider); // Show API Lightbox.
- setAPIError(true);
- body.classList.add("overflow-hidden");
- return _context4.abrupt("return");
- case 18:
- if (status === 200) {
- // Valid API key - Add to array of tested providers.
- setAPITested(function (prevState) {
- return [].concat(_toConsumableArray(prevState), [newProvider]);
- });
- }
- _context4.next = 27;
- break;
- case 21:
- _context4.prev = 21;
- _context4.t0 = _context4["catch"](7);
- // Catch all other errors.
- setShowAPILightbox(newProvider); // Show API Lightbox.
- body.classList.add("overflow-hidden");
- setAPIError(true);
- return _context4.abrupt("return");
- case 27:
- // Add slight delay for loading effect.
- setTimeout(function () {
- setFilterOptions(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[newProvider].filters); // Update filter options.
- setActiveProvider(newProvider); // Switch the provider.
- }, delay);
- case 28:
- case "end":
- return _context4.stop();
- }
- }, _callee4, null, [[7, 21]]);
- }));
- return _switchProvider.apply(this, arguments);
- }
- function getSuggestions(_x4) {
- return _getSuggestions.apply(this, arguments);
- }
- /**
- * Renders the Masonry layout.
- *
- * @since 3.0
- */
- function _getSuggestions() {
- _getSuggestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(term) {
- var api_url;
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
- while (1) switch (_context5.prev = _context5.next) {
- case 0:
- if (!(!term || (term === null || term === void 0 ? void 0 : term.length) < 3)) {
- _context5.next = 2;
- break;
- }
- return _context5.abrupt("return");
- case 2:
- // API endpoint URL.
- api_url = instant_img_localize.root + "instant-images-extended/suggestions/?term=".concat(term); // Get suggestions.
- _context5.next = 5;
- return axios__WEBPACK_IMPORTED_MODULE_27__["default"].get(api_url).then(function (res) {
- setSuggestions(res.data);
- })["catch"](function (error) {
- console.warn(error);
- });
- case 5:
- case "end":
- return _context5.stop();
- }
- }, _callee5);
- }));
- return _getSuggestions.apply(this, arguments);
- }
- function renderLayout() {
- imagesLoaded(photosRef.current, function () {
- if (!isBlockEditor) {
- msnryRef.current = new (masonry_layout__WEBPACK_IMPORTED_MODULE_2___default())(photosRef.current, {
- itemSelector: ".photo"
- });
- photosRef.current.querySelectorAll(".photo").forEach(function (el) {
- el.classList.add("in-view");
- });
- }
- setTimeout(function () {
- // Delay to allow for rendering and set up.
- setLoading(false);
- setLoadingMore(false);
- if (!mounted) {
- setMounted(true);
- }
- }, delay);
- });
- }
-
- /**
- * Reset the scroll position for the WP block only.
- */
- function resetScrollPosition() {
- if (wpBlock && photosRef !== null && photosRef !== void 0 && photosRef.current) {
- photosRef === null || photosRef === void 0 ? void 0 : photosRef.current.scroll({
- top: 0,
- left: 0,
- behavior: "smooth"
- });
- }
- }
-
- /**
- * A checker to determine if there are remaining search results.
- *
- * @param {number} num Total search results.
- * @since 3.0
- */
- function checkResults(num) {
- setDone(parseInt(num) === 0 || num === undefined);
- }
-
- /**
- * Escape handler to close edit windows on photos.
- *
- * @param {Event} e The key event.
- */
- function escFunction(e) {
- var key = e.key;
- if (key === "Escape") {
- var editing = photosRef.current.querySelectorAll(".edit-screen.editing");
- if (editing) {
- _toConsumableArray(editing).forEach(function (element) {
- element === null || element === void 0 ? void 0 : element.classList.remove("editing");
- });
- }
- }
- }
-
- /* Search callback. */
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- if (!(search !== null && search !== void 0 && search.active)) {
- // Reset search filters when search is false.
- setSearchFilters({});
- }
- }, [search]); // eslint-disable-line react-hooks/exhaustive-deps
-
- /* Search filters change callback. */
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- if (mounted && search !== null && search !== void 0 && search.active) {
- doSearch(search === null || search === void 0 ? void 0 : search.term);
- }
- }, [searchFilters]); // eslint-disable-line react-hooks/exhaustive-deps
-
- // Filters change callback.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- if (mounted) {
- getPhotos();
- }
- }, [filters]); // eslint-disable-line react-hooks/exhaustive-deps
-
- // Provider change callback.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- setFilterOptions(_constants_filters__WEBPACK_IMPORTED_MODULE_5__.FILTERS[activeProvider].filters);
- setFilters({}); // Trigger filter change.
- }, [activeProvider]); // eslint-disable-line react-hooks/exhaustive-deps
-
- // Scroll in-view callback.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- // Infinite scrolling.
- loadMorePhotos();
- }, [inView]); // eslint-disable-line react-hooks/exhaustive-deps
-
- // Results callback.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- renderLayout();
- }, [results]); // eslint-disable-line react-hooks/exhaustive-deps
-
- // Initial page load.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- setLoading(false);
- wrapper.classList.add("loaded");
-
- // Block editor, get initial set of photos.
- if (isBlockEditor) {
- getPhotos();
- }
- // Add global escape listener.
- document.addEventListener("keydown", escFunction, false);
- return function () {
- document.removeEventListener("keydown", escFunction, false);
- };
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
-
- return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement(_common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__.PluginProvider, {
- value: {
- provider: activeProvider,
- wpBlock: wpBlock,
- mediaModal: mediaModal,
- blockSidebar: blockSidebar,
- clientId: clientId,
- search: search,
- apiError: apiError,
- getPhotos: getPhotos,
- searchHandler: searchHandler,
- filterSearch: filterSearch,
- suggestions: suggestions,
- getSuggestions: getSuggestions
- }
- }, wpBlock ? /*#__PURE__*/React.createElement(_editor_block_components_Header__WEBPACK_IMPORTED_MODULE_6__["default"], {
- switchProvider: switchProvider
- }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_ProviderNav__WEBPACK_IMPORTED_MODULE_18__["default"], {
- switchProvider: switchProvider
- }), /*#__PURE__*/React.createElement(_cta_Extended__WEBPACK_IMPORTED_MODULE_23__.ExtendedCTA, null)), /*#__PURE__*/React.createElement(_RestAPIError__WEBPACK_IMPORTED_MODULE_19__["default"], null), /*#__PURE__*/React.createElement("div", {
- className: "control-nav"
- }, /*#__PURE__*/React.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("control-nav--filters-wrap", apiError || search !== null && search !== void 0 && search.active ? "inactive" : null)
- }, filterOptions && (_Object$entries = Object.entries(filterOptions)) !== null && _Object$entries !== void 0 && _Object$entries.length ? /*#__PURE__*/React.createElement("div", {
- className: "control-nav--filters"
- }, Object.entries(filterOptions).map(function (_ref, index) {
- var _ref2 = _slicedToArray(_ref, 2),
- key = _ref2[0],
- filter = _ref2[1];
- return /*#__PURE__*/React.createElement(_Filter__WEBPACK_IMPORTED_MODULE_15__["default"], {
- key: "".concat(activeProvider, "-").concat(index, "-").concat(key),
- data: filter,
- filterKey: key,
- handler: filterPhotos
- });
- })) : null), /*#__PURE__*/React.createElement(_search_SearchForm__WEBPACK_IMPORTED_MODULE_24__["default"], {
- ref: searchInputRef
- })), /*#__PURE__*/React.createElement("div", {
- id: "photo-listing",
- className: loading ? "loading" : null
- }, /*#__PURE__*/React.createElement(_search_SearchHeader__WEBPACK_IMPORTED_MODULE_25__["default"], null), wpBlock ? /*#__PURE__*/React.createElement(_ResultsWPBlock__WEBPACK_IMPORTED_MODULE_21__["default"], {
- ref: photosRef,
- data: results,
- done: done,
- loadMorePhotos: loadMorePhotos
- }) : /*#__PURE__*/React.createElement(_Results__WEBPACK_IMPORTED_MODULE_20__["default"], {
- ref: photosRef,
- data: results
- }), /*#__PURE__*/React.createElement(_NoResults__WEBPACK_IMPORTED_MODULE_17__["default"], {
- total: search === null || search === void 0 ? void 0 : search.results,
- is_search: search === null || search === void 0 ? void 0 : search.active
- }), /*#__PURE__*/React.createElement(_LoadMore__WEBPACK_IMPORTED_MODULE_16__["default"], {
- ref: loadMoreRef,
- loadMorePhotos: loadMorePhotos,
- loading: loadingMore,
- done: done
- }), /*#__PURE__*/React.createElement(_APILightbox__WEBPACK_IMPORTED_MODULE_13__["default"], {
- provider: showAPILightbox,
- callback: closeAPILightbox
- }), /*#__PURE__*/React.createElement(_ErrorLightbox__WEBPACK_IMPORTED_MODULE_14__["default"], null), /*#__PURE__*/React.createElement(_Tooltip__WEBPACK_IMPORTED_MODULE_22__["default"], null))));
-}
-
-/***/ }),
-
-/***/ "./src/js/components/LoadMore.js":
-/*!***************************************!*\
- !*** ./src/js/components/LoadMore.js ***!
- \***************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
-
-
-
-
-/**
- * Render the LoadMore component.
- *
- * @return {JSX.Element} The LoadMore component.
- */
-var LoadMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
- var loadMorePhotos = props.loadMorePhotos,
- loading = props.loading,
- done = props.done;
- return /*#__PURE__*/React.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("load-more-wrap", loading ? "loading" : null, done ? "done" : null),
- ref: ref
- }, /*#__PURE__*/React.createElement("button", {
- type: "button",
- className: "button",
- onClick: function onClick() {
- return loadMorePhotos();
- }
- }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Load More Images", "instant-images")));
-});
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadMore);
-
-/***/ }),
-
-/***/ "./src/js/components/NoResults.js":
-/*!****************************************!*\
- !*** ./src/js/components/NoResults.js ***!
- \****************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ NoResults)
-/* harmony export */ });
-/**
- * Render the NoResults component.
- *
- * @param {Object} props The component props.
- * @return {JSX.Element} The NoResults component.
- */
-function NoResults(props) {
- var _props$total = props.total,
- total = _props$total === void 0 ? 0 : _props$total,
- _props$is_search = props.is_search,
- is_search = _props$is_search === void 0 ? false : _props$is_search;
- if (!is_search || is_search && total >= 1) {
- // Bail if not search or search total is greater than 1.
- return null;
- }
- return /*#__PURE__*/React.createElement("div", {
- className: "instant-images-no-results"
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("h3", null, instant_img_localize.no_results, " "), /*#__PURE__*/React.createElement("p", null, instant_img_localize.no_results_desc, " ")));
-}
-
-/***/ }),
-
-/***/ "./src/js/components/Photo.js":
-/*!************************************!*\
- !*** ./src/js/components/Photo.js ***!
- \************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Photo)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js");
-/* harmony import */ var _editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editor/utils/insertImage */ "./src/js/editor/utils/insertImage.js");
-/* harmony import */ var _editor_utils_setFeaturedImage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../editor/utils/setFeaturedImage */ "./src/js/editor/utils/setFeaturedImage.js");
-/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../functions/helpers */ "./src/js/functions/helpers.js");
-/* harmony import */ var _functions_providers_unsplash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../functions/providers/unsplash */ "./src/js/functions/providers/unsplash.js");
-/* harmony import */ var _functions_generateAttribution__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../functions/generateAttribution */ "./src/js/functions/generateAttribution.js");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__);
-function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
-function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
-function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
-function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
-function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
-function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
-
-
-
-
-
-
-
-
-
-
-/**
- * Render the Photo component.
- *
- * @param {Object} props The component props.
- * @return {JSX.Element} The Photo component.
- */
-function Photo(props) {
- var result = props.result,
- setInactive = props.setInactive;
- var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(),
- provider = _usePluginContext.provider,
- _usePluginContext$wpB = _usePluginContext.wpBlock,
- wpBlock = _usePluginContext$wpB === void 0 ? false : _usePluginContext$wpB,
- _usePluginContext$med = _usePluginContext.mediaModal,
- mediaModal = _usePluginContext$med === void 0 ? false : _usePluginContext$med,
- _usePluginContext$blo = _usePluginContext.blockSidebar,
- blockSidebar = _usePluginContext$blo === void 0 ? false : _usePluginContext$blo,
- clientId = _usePluginContext.clientId;
- var id = result.id,
- filename = result.id,
- permalink = result.permalink,
- title = result.title,
- alt = result.alt,
- caption = result.caption,
- attribution = result.attribution,
- _result$extension = result.extension,
- extension = _result$extension === void 0 ? "jpg" : _result$extension,
- likes = result.likes,
- dimensions = result.dimensions,
- urls = result.urls,
- user = result.user;
-
- // Deconstruct image URLs.
- var thumb = urls.thumb,
- full = urls.full,
- download_url = urls.download_url;
-
- // Deconstruct user data.
- var user_name = user.name,
- user_photo = user.photo,
- user_url = user.url;
- var container = document.querySelector(".instant-img-container");
- var likeDisplay = parseInt(likes) === 1 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)("Like", "instant-images") : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_8__.__)("Likes", "instant-images");
- var _instant_img_localize = instant_img_localize,
- _instant_img_localize2 = _instant_img_localize.attribution_hook,
- attribution_hook = _instant_img_localize2 === void 0 ? false : _instant_img_localize2,
- _instant_img_localize3 = _instant_img_localize.auto_attribution,
- auto_attribution = _instant_img_localize3 === void 0 ? false : _instant_img_localize3;
-
- // Get the attribution text.
- var imageAttribution = attribution_hook ? (0,_functions_generateAttribution__WEBPACK_IMPORTED_MODULE_7__["default"])(attribution_hook, provider, permalink, user) : attribution;
- var imageCaption = auto_attribution === "1" ? imageAttribution : caption;
-
- // Photo state.
- var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)({
- filename: filename,
- title: title,
- alt: alt,
- caption: imageCaption
- }),
- _useState2 = _slicedToArray(_useState, 2),
- imageDetails = _useState2[0],
- setImageDetails = _useState2[1];
- var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
- _useState4 = _slicedToArray(_useState3, 2),
- inProgress = _useState4[0],
- setInProgress = _useState4[1]; // inProgress state.
- var _useState5 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)("loaded"),
- _useState6 = _slicedToArray(_useState5, 2),
- status = _useState6[0],
- setStatus = _useState6[1]; // Status state.
- var _useState7 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(""),
- _useState8 = _slicedToArray(_useState7, 2),
- editURL = _useState8[0],
- setEditURL = _useState8[1]; // Edit URL state.
-
- // Refs.
- var photo = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var upload = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var editScreen = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var captionRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
-
- // Gutenberg.
- var setAsFeaturedImage = false;
- var insertIntoPost = false;
-
- /**
- * Function to trigger the image download.
- *
- * @since 4.3
- */
- function download() {
- if (inProgress || status === "success" || status === "uploaded") {
- return false; // Exit if uploading, uploaded or success.
- }
-
- var target = upload === null || upload === void 0 ? void 0 : upload.current;
- setInProgress(true);
- setStatus("uploading");
- if (wpBlock) {
- setInactive(true); // Make Instant Images inactive after selecting an image.
- }
-
- // API URL
- var api = instant_img_localize.root + "instant-images/download/";
-
- // Data Params
- var data = {
- provider: provider,
- id: target.getAttribute("data-id"),
- image_url: target.getAttribute("data-url"),
- filename: target.getAttribute("data-id"),
- extension: extension,
- custom_filename: target.getAttribute("data-filename"),
- title: target.getAttribute("data-title"),
- alt: target.getAttribute("data-alt"),
- caption: target.getAttribute("data-caption"),
- parent_id: instant_img_localize.parent_id,
- lang: instant_img_localize.lang
- };
-
- // Config Params
- var config = {
- credentials: "same-origin",
- headers: {
- "X-WP-Nonce": instant_img_localize.nonce,
- "Content-Type": "application/json"
- }
- };
- axios__WEBPACK_IMPORTED_MODULE_9__["default"].post(api, JSON.stringify(data), config).then(function (res) {
- var response = res.data;
- if (response) {
- // Successful response from server
- var success = response.success;
- var attachment = response.attachment;
- var admin_url = response.admin_url;
- var msg = response.msg;
- if (success) {
- var edit_url = "".concat(admin_url, "post.php?post=").concat(attachment.id, "&action=edit"); // Edit URL.
- setEditURL(edit_url);
- uploadComplete(target, msg, attachment.id); // Success/Upload Complete
-
- // Trigger a download at Unsplash.
- if (provider === "unsplash" && download_url) {
- (0,_functions_providers_unsplash__WEBPACK_IMPORTED_MODULE_6__.unsplashDownload)(download_url);
- }
-
- /**
- * Gutenberg options.
- */
-
- // Set Featured Image via Sidebar.
- if (blockSidebar && setAsFeaturedImage) {
- (0,_editor_utils_setFeaturedImage__WEBPACK_IMPORTED_MODULE_4__["default"])(attachment);
- setAsFeaturedImage = false;
- closeMediaModal();
- }
-
- // Insert Image via Sidebar.
- if (blockSidebar && insertIntoPost) {
- setTimeout(function () {
- // Delay for effect.
- (0,_editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__["default"])(attachment);
- }, 250);
- closeMediaModal();
- insertIntoPost = false;
- }
-
- // Insert Image via WP Block.
- if (wpBlock && clientId) {
- setStatus("uploaded");
- setTimeout(function () {
- // Delay for effect.
- (0,_editor_utils_insertImage__WEBPACK_IMPORTED_MODULE_3__["default"])(attachment, clientId);
- }, 350);
- closeMediaModal();
- insertIntoPost = false;
- }
-
- /**
- * Media Modal.
- * If is media popup, redirect user to media-upload settings.
- */
- if (container.dataset.mediaPopup === "true" && !blockSidebar) {
- window.location = "media-upload.php?type=image&tab=library&attachment_id=" + attachment.id;
- }
- } else {
- // Error
- uploadError(target, msg);
- }
- } else {
- // Error
- uploadError(target, instant_img_localize.error_upload);
- }
- })["catch"](function (error) {
- console.warn(error);
- });
- }
-
- /**
- * Upload complete function.
- *
- * @param {Element} target Clicked item.
- * @param {string} msg Success Msg.
- * @param {string} imageID Attachment id.
- * @since 3.0
- */
- function uploadComplete(target, msg, imageID) {
- if (!(photo !== null && photo !== void 0 && photo.current)) {
- return;
- }
- setImageTitle(target, msg);
- setStatus("uploaded");
- setInProgress(false);
-
- // Remove uploaded status after 3.5 seconds.
- setTimeout(function () {
- setStatus("success");
- }, 3500);
-
- // Refresh Media Router/Modal.
- refreshMediaModal(imageID);
- }
-
- /**
- * Handler to send user to edit photo link after upload.
- *
- * @since 5.2.0
- */
- function editAfterUpload() {
- if (editURL) {
- window.location = editURL;
- }
- }
-
- /**
- * Function used to trigger a download and then set as featured image
- *
- * @param {Element} e The clicked element.
- * @since 4.0
- */
- function setFeaturedImageClick(e) {
- (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e);
- if (upload.current) {
- setAsFeaturedImage = true;
- upload.current.click();
- }
- }
-
- /**
- * Function used to insert an image directly into the block (Gutenberg) editor.
- *
- * @param {Element} e The clicked element.
- * @since 4.0
- */
- function insertImageIntoPost(e) {
- (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e);
- if (upload.current) {
- insertIntoPost = true;
- upload.current.click();
- }
- }
-
- /**
- * Refresh Media Modal and select item after it's been uploaded.
- *
- * @param {string} modalID The media modal ID.
- * @since 4.3
- */
- function refreshMediaModal(modalID) {
- if (mediaModal && wp.media && wp.media.frame && wp.media.frame.el) {
- var mediaModalEl = wp.media.frame.el;
- var mediaTab = mediaModalEl.querySelector("#menu-item-browse");
- if (mediaTab) {
- // Open the 'Media Library' tab.
- mediaTab.click();
- }
-
- // Delay to allow for tab switching
- setTimeout(function () {
- if (wp.media.frame.content.get() !== null) {
- // Force a refresh of the mdeia modal content.
- wp.media.frame.content.get().collection._requery(true);
- }
-
- // Select the attached that was just uploaded.
- var selection = wp.media.frame.state().get("selection");
- var selected = parseInt(modalID);
- selection.reset(selected ? [wp.media.attachment(selected)] : []);
- }, 100);
- }
- }
-
- /**
- * Function runs when error occurs on upload or resize.
- *
- * @param {Element} target Current clicked item.
- * @param {string} msg Error Msg.
- * @since 3.0
- */
- function uploadError(target, msg) {
- setImageTitle(target, msg);
- setInProgress(false);
- setStatus("error");
- setInactive(false);
- console.warn(msg);
- }
-
- /**
- * Set the title attribute of target.
- *
- * @param {Element} target Clicked element.
- * @param {string} msg Title message from JSON.
- * @since 3.0
- */
- function setImageTitle(target, msg) {
- target.setAttribute("title", msg); // Remove 'Click to upload...', set new value
- }
-
- /**
- * Displays the edit screen.
- *
- * @param {Element} e The target element.
- * @since 3.2
- */
- function showEditScreen(e) {
- e.preventDefault();
- (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e);
-
- // Get all open edit screens and close them.
- var openEdits = document.querySelectorAll(".edit-screen.editing");
- if (openEdits) {
- openEdits.forEach(function (edit) {
- edit.classList.remove("editing");
- });
- }
-
- // Show edit screen
- editScreen.current.classList.add("editing");
-
- // Set focus on edit screen
- setTimeout(function () {
- editScreen.current.focus({
- preventScroll: true
- });
- }, 150);
- }
-
- /**
- * Handles the change event for the edit screen.
- *
- * @param {Element} e The target element.
- * @since 3.2
- */
- function handleEditChange(e) {
- var target = e.target.name;
- switch (target) {
- case "filename":
- setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, {
- filename: e.target.value
- }));
- break;
- case "title":
- setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, {
- title: e.target.value
- }));
- break;
- case "alt":
- setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, {
- alt: e.target.value
- }));
- break;
- case "caption":
- setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, {
- caption: e.target.value
- }));
- break;
- }
- }
-
- /**
- * Handles the Upload event from the edit screen.
- *
- * @since 3.2
- */
- function uploadNow() {
- editScreen.current.classList.remove("editing"); // Hide edit screen.
- upload.current.click(); // Trigger click.
- }
-
- /**
- * Cancel event for the edit screen.
- *
- * @since 3.2
- */
- function cancelEdit() {
- // Reset image state.
- setImageDetails({
- filename: filename,
- title: title,
- alt: alt,
- caption: imageCaption
- });
-
- // Hide edit screen
- editScreen.current.classList.remove("editing");
-
- // Set focus back on photo.
- upload.current.focus({
- preventScrol: true
- });
- }
-
- /**
- * Close the media modal after an action.
- *
- * @since 4.3
- */
- function closeMediaModal() {
- var mediaModalEl = document.querySelector(".media-modal");
- if (mediaModalEl) {
- var closeBtn = mediaModalEl.querySelector("button.media-modal-close");
- if (!closeBtn) {
- return false;
- }
- closeBtn.click();
- }
- }
-
- /**
- * Handles adding attribution for images.
- *
- * @param {Element} e The target element.
- * @since 4.5
- */
- function addAttribution(e) {
- e.preventDefault();
- captionRef.current.value = imageAttribution; // Set form value.
- setImageDetails(_objectSpread(_objectSpread({}, imageDetails), {}, {
- caption: imageAttribution
- })); // Set caption state.
- }
-
- return /*#__PURE__*/React.createElement("article", {
- className: "photo",
- ref: photo
- }, /*#__PURE__*/React.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("photo-wrap", "photo-".concat(status))
- }, /*#__PURE__*/React.createElement("div", {
- className: "img-wrap"
- }, /*#__PURE__*/React.createElement("button", {
- className: "photo-upload",
- ref: upload,
- "data-id": id,
- "data-url": full,
- "data-filename": imageDetails.filename,
- "data-title": imageDetails.title,
- "data-alt": imageDetails.alt,
- "data-caption": imageDetails.caption,
- title: wpBlock ? instant_img_localize.insert_into_post : instant_img_localize.upload,
- onClick: function onClick() {
- return download();
- }
- }, /*#__PURE__*/React.createElement("img", {
- src: thumb,
- alt: alt,
- className: status
- })), /*#__PURE__*/React.createElement("div", {
- className: "photo-controls"
- }, /*#__PURE__*/React.createElement("a", {
- target: "_blank",
- className: "user fade",
- href: user_url,
- rel: "noopener noreferrer",
- title: "".concat(instant_img_localize.view_all, " @ ").concat(user_name)
- }, /*#__PURE__*/React.createElement("div", {
- className: "user-wrap"
- }, (user_photo === null || user_photo === void 0 ? void 0 : user_photo.length) > 0 && /*#__PURE__*/React.createElement("img", {
- className: "user-wrap--photo",
- src: user_photo,
- alt: ""
- }), user_name)), /*#__PURE__*/React.createElement("div", {
- className: "photo-options"
- }, blockSidebar && !editURL ? /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("button", {
- type: "button",
- className: "set-featured fade",
- "data-title": instant_img_localize.set_as_featured,
- onMouseEnter: function onMouseEnter(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e);
- },
- onMouseLeave: function onMouseLeave(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e);
- },
- onClick: function onClick(e) {
- return setFeaturedImageClick(e);
- }
- }, /*#__PURE__*/React.createElement("i", {
- className: "fa fa-picture-o",
- "aria-hidden": "true"
- }), /*#__PURE__*/React.createElement("span", {
- className: "offscreen"
- }, instant_img_localize.set_as_featured)), /*#__PURE__*/React.createElement("button", {
- type: "button",
- className: "insert fade",
- "data-title": instant_img_localize.insert_into_post,
- onMouseEnter: function onMouseEnter(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e);
- },
- onMouseLeave: function onMouseLeave(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e);
- },
- onClick: function onClick(e) {
- return insertImageIntoPost(e);
- }
- }, /*#__PURE__*/React.createElement("i", {
- className: "fa fa-plus",
- "aria-hidden": "true"
- }), /*#__PURE__*/React.createElement("span", {
- className: "offscreen"
- }, instant_img_localize.insert_into_post))) : null, !!wpBlock && /*#__PURE__*/React.createElement("button", {
- type: "button",
- className: "insert fade",
- "data-title": instant_img_localize.insert_into_post,
- onMouseEnter: function onMouseEnter(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e);
- },
- onMouseLeave: function onMouseLeave(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e);
- },
- onClick: function onClick(e) {
- return insertImageIntoPost(e);
- }
- }, /*#__PURE__*/React.createElement("i", {
- className: "fa fa-plus",
- "aria-hidden": "true"
- }), /*#__PURE__*/React.createElement("span", {
- className: "offscreen"
- }, instant_img_localize.insert_into_post)), editURL ? /*#__PURE__*/React.createElement("button", {
- onClick: function onClick() {
- return editAfterUpload();
- },
- className: "edit-photo-admin fade",
- "data-title": instant_img_localize.edit_upload,
- onMouseEnter: function onMouseEnter(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e);
- },
- onMouseLeave: function onMouseLeave(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e);
- }
- }, /*#__PURE__*/React.createElement("i", {
- className: "fa fa-pencil",
- "aria-hidden": "true"
- }), /*#__PURE__*/React.createElement("span", {
- className: "offscreen"
- }, instant_img_localize.edit_upload)) : /*#__PURE__*/React.createElement("button", {
- onClick: function onClick(e) {
- return showEditScreen(e);
- },
- className: "edit-photo fade",
- "data-title": instant_img_localize.edit_details,
- onMouseEnter: function onMouseEnter(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e);
- },
- onMouseLeave: function onMouseLeave(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e);
- }
- }, /*#__PURE__*/React.createElement("i", {
- className: "fa fa-cog",
- "aria-hidden": "true"
- }), /*#__PURE__*/React.createElement("span", {
- className: "offscreen"
- }, instant_img_localize.edit_details)))), /*#__PURE__*/React.createElement("div", {
- className: "photo-meta"
- }, likes ? /*#__PURE__*/React.createElement("span", {
- className: "likes tooltip--above",
- "data-title": likes + " " + likeDisplay,
- onMouseEnter: function onMouseEnter(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e);
- },
- onMouseLeave: function onMouseLeave(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e);
- }
- }, /*#__PURE__*/React.createElement("i", {
- className: "fa fa-heart heart-like",
- "aria-hidden": "true"
- }), " ", likes) : null, /*#__PURE__*/React.createElement("a", {
- className: "tooltip--above",
- href: permalink,
- "data-title": "".concat(instant_img_localize.open_external, " ").concat((0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.capitalizeFirstLetter)(provider)),
- onMouseEnter: function onMouseEnter(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.showTooltip)(e);
- },
- onMouseLeave: function onMouseLeave(e) {
- return (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.hideTooltip)(e);
- },
- rel: "noopener noreferrer",
- target: "_blank"
- }, /*#__PURE__*/React.createElement("i", {
- className: "fa fa-external-link",
- "aria-hidden": "true"
- }), /*#__PURE__*/React.createElement("span", {
- className: "offscreen"
- }, "".concat(instant_img_localize.open_external, " ").concat((0,_functions_helpers__WEBPACK_IMPORTED_MODULE_5__.capitalizeFirstLetter)(provider)))))), /*#__PURE__*/React.createElement("div", {
- className: "edit-screen",
- tabIndex: "0",
- ref: editScreen
- }, /*#__PURE__*/React.createElement("div", {
- className: "edit-screen--title"
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
- className: "heading"
- }, instant_img_localize.edit_details), dimensions && dimensions.length > 0 && /*#__PURE__*/React.createElement("p", {
- className: "dimensions"
- }, dimensions)), /*#__PURE__*/React.createElement("div", {
- className: "preview",
- style: {
- backgroundImage: "url(".concat(thumb, ")")
- }
- })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_filename, ":"), /*#__PURE__*/React.createElement("input", {
- type: "text",
- name: "filename",
- "data-original": filename,
- placeholder: imageDetails.filename,
- value: imageDetails.filename,
- onChange: function onChange(e) {
- return handleEditChange(e);
- }
- }), /*#__PURE__*/React.createElement("em", null, ".", extension)), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_title, ":"), /*#__PURE__*/React.createElement("input", {
- type: "text",
- name: "title",
- "data-original": title,
- placeholder: title,
- value: imageDetails.title || "",
- onChange: function onChange(e) {
- return handleEditChange(e);
- }
- })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_alt, ":"), /*#__PURE__*/React.createElement("input", {
- type: "text",
- name: "alt",
- "data-original": alt,
- value: imageDetails.alt || "",
- onChange: function onChange(e) {
- return handleEditChange(e);
- }
- })), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", null, instant_img_localize.edit_caption, ":"), /*#__PURE__*/React.createElement("textarea", {
- rows: "4",
- name: "caption",
- "data-original": imageCaption,
- onChange: function onChange(e) {
- return handleEditChange(e);
- },
- value: imageDetails.caption || "",
- ref: captionRef
- })), imageAttribution ? /*#__PURE__*/React.createElement("div", {
- className: "add-attribution-row"
- }, /*#__PURE__*/React.createElement("button", {
- onClick: function onClick(e) {
- return addAttribution(e);
- },
- type: "button"
- }, instant_img_localize.attribution)) : null, /*#__PURE__*/React.createElement("div", {
- className: "edit-screen--controls"
- }, /*#__PURE__*/React.createElement("button", {
- type: "button",
- className: "button button-secondary",
- onClick: function onClick(e) {
- return cancelEdit(e);
- }
- }, instant_img_localize.cancel), " ", "\xA0", /*#__PURE__*/React.createElement("button", {
- type: "button",
- className: "button button-primary",
- onClick: function onClick() {
- return uploadNow();
- }
- }, wpBlock ? instant_img_localize.insert_into_post : instant_img_localize.upload_now))), /*#__PURE__*/React.createElement("div", {
- className: "photo-status"
- })));
-}
-
-/***/ }),
-
-/***/ "./src/js/components/ProviderIcons.js":
-/*!********************************************!*\
- !*** ./src/js/components/ProviderIcons.js ***!
- \********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "OpenverseIcon": () => (/* binding */ OpenverseIcon),
-/* harmony export */ "PexelsIcon": () => (/* binding */ PexelsIcon),
-/* harmony export */ "PixabayIcon": () => (/* binding */ PixabayIcon),
-/* harmony export */ "UnsplashIcon": () => (/* binding */ UnsplashIcon),
-/* harmony export */ "getProviderIcon": () => (/* binding */ getProviderIcon)
-/* harmony export */ });
-/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js");
-
-
-/**
- * Return the provider icon.
- *
- * @param {string} provider The provider.
- * @return {JSX.Element} The provider icon.
- */
-function getProviderIcon(provider) {
- if (!provider) {
- return null;
- }
- return _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider.toLowerCase()].icon ? _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider.toLowerCase()].icon() : null;
-}
-
-/**
- * Unsplash Icon.
- */
-function UnsplashIcon() {
- return /*#__PURE__*/React.createElement("svg", {
- width: "32",
- height: "32",
- viewBox: "0 0 32 32",
- xmlns: "http://www.w3.org/2000/svg"
- }, /*#__PURE__*/React.createElement("path", {
- d: "M10 9V0H22V9H10ZM22 14H32V32H0V14H10V23H22V14Z",
- fill: "black"
- }));
-}
-
-/**
- * Pixabay Icon.
- */
-function PixabayIcon() {
- return /*#__PURE__*/React.createElement("svg", {
- width: "32",
- height: "32",
- viewBox: "0 0 32 32",
- xmlns: "http://www.w3.org/2000/svg"
- }, /*#__PURE__*/React.createElement("g", {
- clipPath: "url(#clip0_307_143)"
- }, /*#__PURE__*/React.createElement("path", {
- d: "M0 0V32H32V0H0Z",
- fill: "#48A947"
- }), /*#__PURE__*/React.createElement("path", {
- d: "M6.83734 22.3147V28C5.93067 28.0427 5.02401 28.032 4.11734 27.9787C4.09601 27.7014 4.06401 27.4667 4.06401 27.2427C4.06401 23.2427 4.05334 19.2534 4.06401 15.2534C4.07467 12.032 5.97334 9.32269 8.85334 8.37335C13.1307 6.95469 17.4507 10.048 17.8453 14.3894C18.144 17.6534 16.4267 20.5547 13.568 21.7814C12.6507 22.176 11.6907 22.304 10.7093 22.304C9.45067 22.3147 8.21334 22.3147 6.83734 22.3147ZM6.84801 19.4454C8.24534 19.4454 9.54667 19.424 10.848 19.4454C13.1627 19.488 14.816 17.76 15.104 15.712C15.424 13.3654 13.7813 11.2107 11.4453 10.88H11.4347C9.25867 10.592 7.06134 12.2774 6.88001 14.528C6.74134 16.128 6.84801 17.728 6.84801 19.4454Z",
- fill: "#F9FBF9"
- }), /*#__PURE__*/React.createElement("path", {
- d: "M25.4827 14.9334L30.656 22.2081H27.3067L23.4667 16.9494C22.0694 18.6881 20.9067 20.4907 19.584 22.2081H16.2454L21.408 14.9334L16.8107 8.04272H20.16L23.4454 12.9494L26.7307 8.04272H30.0694L25.4827 14.9334Z",
- fill: "#FAFCFA"
- }), /*#__PURE__*/React.createElement("path", {
- d: "M6.848 19.4453C6.848 17.7279 6.74134 16.1173 6.86934 14.5386C7.05067 12.2879 9.248 10.6026 11.424 10.8906C13.7707 11.2106 15.4133 13.3653 15.0933 15.7119C14.816 17.7599 13.152 19.4879 10.8373 19.4453C9.54667 19.4239 8.24534 19.4453 6.848 19.4453Z",
- fill: "#4AA949"
- })), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
- id: "clip0_307_143"
- }, /*#__PURE__*/React.createElement("rect", {
- width: "32",
- height: "32",
- fill: "white"
- }))));
-}
-
-/**
- * Openverse Icon.
- */
-function OpenverseIcon() {
- return /*#__PURE__*/React.createElement("svg", {
- width: "32",
- height: "32",
- viewBox: "0 0 32 32",
- xmlns: "http://www.w3.org/2000/svg"
- }, /*#__PURE__*/React.createElement("path", {
- d: "M25.8578 14.32C29.6708 14.32 32.7618 11.1144 32.7618 7.16C32.7618 3.20564 29.6708 0 25.8578 0C22.0448 0 18.9539 3.20564 18.9539 7.16C18.9539 11.1144 22.0448 14.32 25.8578 14.32Z",
- fill: "#000000"
- }), /*#__PURE__*/React.createElement("path", {
- d: "M0.761841 7.16C0.761841 11.1 3.84742 14.32 7.66584 14.32V0C3.84742 0 0.761841 3.2 0.761841 7.16Z",
- fill: "#000000"
- }), /*#__PURE__*/React.createElement("path", {
- d: "M9.85791 7.16C9.85791 11.1 12.9435 14.32 16.7619 14.32V0C12.9628 0 9.85791 3.2 9.85791 7.16Z",
- fill: "#000000"
- }), /*#__PURE__*/React.createElement("path", {
- d: "M25.8578 31.9399C29.6708 31.9399 32.7618 28.7343 32.7618 24.78C32.7618 20.8256 29.6708 17.62 25.8578 17.62C22.0448 17.62 18.9539 20.8256 18.9539 24.78C18.9539 28.7343 22.0448 31.9399 25.8578 31.9399Z",
- fill: "#000000"
- }), /*#__PURE__*/React.createElement("path", {
- d: "M9.85791 24.7801C9.85791 28.72 12.9435 31.9401 16.7619 31.9401V17.64C12.9628 17.64 9.85791 20.84 9.85791 24.7801Z",
- fill: "#000000"
- }), /*#__PURE__*/React.createElement("path", {
- d: "M0.761841 24.84C0.761841 28.8 3.84742 32 7.66584 32V17.7C3.84742 17.7 0.761841 20.9 0.761841 24.84Z",
- fill: "#000000"
- }));
-}
-
-/**
- * Pexels Icon.
- */
-function PexelsIcon() {
- return /*#__PURE__*/React.createElement("svg", {
- width: "32px",
- height: "32px",
- viewBox: "0 0 32 32",
- xmlns: "http://www.w3.org/2000/svg"
- }, /*#__PURE__*/React.createElement("path", {
- d: "M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z",
- fill: "#05A081"
- }), /*#__PURE__*/React.createElement("path", {
- d: "M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z",
- fill: "#fff"
- }));
-}
-
-/***/ }),
-
-/***/ "./src/js/components/ProviderNav.js":
-/*!******************************************!*\
- !*** ./src/js/components/ProviderNav.js ***!
- \******************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ ProviderNav)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js");
-/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js");
-/* harmony import */ var _ProviderIcons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ProviderIcons */ "./src/js/components/ProviderIcons.js");
-
-
-
-
-var providers = _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.providers;
-
-/**
- * Render the ProviderNav component.
- *
- * @param {Object} props The component props.
- * @param {Object} props.switchProvider The function to switch the provider.
- * @return {JSX.Element} The ProviderNav component.
- */
-function ProviderNav(_ref) {
- var switchProvider = _ref.switchProvider;
- var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(),
- provider = _usePluginContext.provider;
- return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !!(providers !== null && providers !== void 0 && providers.length) && /*#__PURE__*/React.createElement("nav", {
- className: "provider-nav"
- }, providers.map(function (item, index) {
- return /*#__PURE__*/React.createElement("div", {
- key: "provider-".concat(index)
- }, /*#__PURE__*/React.createElement("button", {
- onClick: function onClick() {
- return switchProvider(item.toLowerCase());
- },
- className: provider === item.toLowerCase() ? "provider-nav--btn active" : "provider-nav--btn"
- }, (0,_ProviderIcons__WEBPACK_IMPORTED_MODULE_3__.getProviderIcon)(item), /*#__PURE__*/React.createElement("span", null, item), _constants_API__WEBPACK_IMPORTED_MODULE_2__.API[item.toLowerCase()]["new"] && /*#__PURE__*/React.createElement("span", {
- className: "provider-nav--new"
- }, instant_img_localize["new"])));
- })));
-}
-
-/***/ }),
-
-/***/ "./src/js/components/RestAPIError.js":
-/*!*******************************************!*\
- !*** ./src/js/components/RestAPIError.js ***!
- \*******************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ RestAPIError)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
-function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
-function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
-
-/**
- * Render the RestAPIError component.
- *
- * @return {JSX.Element} The RestAPIError component.
- */
-function RestAPIError() {
- var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true),
- _useState2 = _slicedToArray(_useState, 2),
- access = _useState2[0],
- setAccess = _useState2[1];
-
- /**
- * Test users access to the REST API endpoint.
- *
- * @since 3.2
- */
- function test() {
- var testURL = instant_img_localize.root + "instant-images/test/";
- var restAPITest = new XMLHttpRequest();
- restAPITest.open("POST", testURL, true);
- restAPITest.setRequestHeader("X-WP-Nonce", instant_img_localize.nonce);
- restAPITest.setRequestHeader("Content-Type", "application/json");
- restAPITest.send();
- restAPITest.onload = function () {
- if (restAPITest.status >= 200 && restAPITest.status < 400) {
- var response = JSON.parse(restAPITest.response);
- var success = response.success;
- if (!success) {
- setAccess(false);
- }
- } else {
- setAccess(false);
- }
- };
- restAPITest.onerror = function (errorMsg) {
- console.warn(errorMsg);
- setAccess(false);
- };
- }
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- test();
- }, []);
- return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !access ? /*#__PURE__*/React.createElement("div", {
- className: "error-messaging"
- }, /*#__PURE__*/React.createElement("strong", null, instant_img_localize.error_restapi), instant_img_localize.error_restapi_desc) : null);
-}
-
-/***/ }),
-
-/***/ "./src/js/components/Results.js":
-/*!**************************************!*\
- !*** ./src/js/components/Results.js ***!
- \**************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _Photo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Photo */ "./src/js/components/Photo.js");
-/* harmony import */ var _Sponsor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sponsor */ "./src/js/components/Sponsor.js");
-function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
-function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
-function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
-
-
-
-/**
- * Render the Results component.
- *
- * @return {JSX.Element} The Results component.
- */
-var Results = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
- var data = props.data;
- var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
- _useState2 = _slicedToArray(_useState, 2),
- inactive = _useState2[0],
- setInactive = _useState2[1];
- return /*#__PURE__*/React.createElement("div", {
- id: "photos",
- className: inactive ? "inactive" : null,
- ref: ref
- }, !!(data !== null && data !== void 0 && data.length) && data.map(function (result, index) {
- return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
- key: "".concat(result.id, "-").concat(index)
- }, (result === null || result === void 0 ? void 0 : result.type) === "instant-images-ad" ? /*#__PURE__*/React.createElement(_Sponsor__WEBPACK_IMPORTED_MODULE_2__["default"], {
- result: result
- }) : /*#__PURE__*/React.createElement(_Photo__WEBPACK_IMPORTED_MODULE_1__["default"], {
- result: result,
- type: result === null || result === void 0 ? void 0 : result.type,
- setInactive: setInactive
- }));
- }));
-});
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Results);
-
-/***/ }),
-
-/***/ "./src/js/components/ResultsWPBlock.js":
-/*!*********************************************!*\
- !*** ./src/js/components/ResultsWPBlock.js ***!
- \*********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var react_intersection_observer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-intersection-observer */ "./node_modules/react-intersection-observer/react-intersection-observer.modern.mjs");
-/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pluginProvider */ "./src/js/common/pluginProvider.js");
-/* harmony import */ var _editor_block_components_Instructions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../editor/block/components/Instructions */ "./src/js/editor/block/components/Instructions.js");
-/* harmony import */ var _editor_block_components_LoadMore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editor/block/components/LoadMore */ "./src/js/editor/block/components/LoadMore.js");
-/* harmony import */ var _Photo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Photo */ "./src/js/components/Photo.js");
-/* harmony import */ var _Sponsor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Sponsor */ "./src/js/components/Sponsor.js");
-function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
-function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
-function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
-
-
-
-
-
-
-
-/**
- * Render the Results component.
- *
- * @return {JSX.Element} The Results component.
- */
-var ResultsWPBlock = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
- var data = props.data,
- _props$done = props.done,
- done = _props$done === void 0 ? false : _props$done,
- loadMorePhotos = props.loadMorePhotos;
- var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(),
- _usePluginContext$wpB = _usePluginContext.wpBlock,
- wpBlock = _usePluginContext$wpB === void 0 ? false : _usePluginContext$wpB;
- var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
- _useState2 = _slicedToArray(_useState, 2),
- inactive = _useState2[0],
- setInactive = _useState2[1];
- var _useInView = (0,react_intersection_observer__WEBPACK_IMPORTED_MODULE_6__.useInView)({
- rootMargin: "0px 0px"
- }),
- _useInView2 = _slicedToArray(_useInView, 2),
- loadMoreRef = _useInView2[0],
- inView = _useInView2[1];
-
- // Scroll in-view callback.
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- if (wpBlock) {
- loadMorePhotos();
- }
- }, [inView]); // eslint-disable-line react-hooks/exhaustive-deps
-
- return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", {
- id: "photos",
- className: inactive ? "inactive" : null,
- ref: ref
- }, !!(data !== null && data !== void 0 && data.length) && data.map(function (result, index) {
- return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
- key: "".concat(result.id, "-").concat(index)
- }, (result === null || result === void 0 ? void 0 : result.type) === "instant-images-ad" ? /*#__PURE__*/React.createElement(_Sponsor__WEBPACK_IMPORTED_MODULE_5__["default"], {
- result: result
- }) : /*#__PURE__*/React.createElement(_Photo__WEBPACK_IMPORTED_MODULE_4__["default"], {
- result: result,
- type: result === null || result === void 0 ? void 0 : result.type,
- setInactive: setInactive
- }));
- }), /*#__PURE__*/React.createElement(_editor_block_components_LoadMore__WEBPACK_IMPORTED_MODULE_3__["default"], {
- done: done,
- ref: loadMoreRef
- })), /*#__PURE__*/React.createElement(_editor_block_components_Instructions__WEBPACK_IMPORTED_MODULE_2__["default"], {
- show: data === null || data === void 0 ? void 0 : data.length
- }));
-});
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ResultsWPBlock);
-
-/***/ }),
-
-/***/ "./src/js/components/Sponsor.js":
-/*!**************************************!*\
- !*** ./src/js/components/Sponsor.js ***!
- \**************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Sponsor)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-
-
-/**
- * Render the Sponsor component.
- *
- * @param {Object} props The component props.
- * @return {JSX.Element} The Sponsor component.
- */
-function Sponsor(props) {
- var result = props.result;
- var _result$data = result.data,
- data = _result$data === void 0 ? null : _result$data;
- var url = (data === null || data === void 0 ? void 0 : data.url) || "";
- var title = (data === null || data === void 0 ? void 0 : data.title) || "";
- var desc = (data === null || data === void 0 ? void 0 : data.description) || "";
- var avatar = (data === null || data === void 0 ? void 0 : data.avatar) || "";
- var _data$image = data.image,
- image = _data$image === void 0 ? null : _data$image;
- var _image$src = image.src,
- src = _image$src === void 0 ? null : _image$src,
- _image$alt = image.alt,
- alt = _image$alt === void 0 ? null : _image$alt;
- var photo = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- var link = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)();
- return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, image && url ?
- /*#__PURE__*/
- // eslint-disable-next-line
- React.createElement("article", {
- className: "photo feature",
- title: desc,
- ref: photo,
- onClick: function onClick() {
- return link.current.click();
- }
- }, /*#__PURE__*/React.createElement("div", {
- className: "photo--wrap"
- }, /*#__PURE__*/React.createElement("span", {
- className: "flag",
- title: instant_img_localize.advertisement
- }, instant_img_localize.ad), /*#__PURE__*/React.createElement("div", {
- className: "img-wrap"
- }, /*#__PURE__*/React.createElement("a", {
- className: "loaded",
- href: url,
- target: "_blank",
- ref: link,
- rel: "noreferrer"
- }, /*#__PURE__*/React.createElement("img", {
- src: src,
- alt: alt
- }))), /*#__PURE__*/React.createElement("div", {
- className: "feature-title"
- }, avatar && /*#__PURE__*/React.createElement("img", {
- src: avatar,
- alt: title
- }), /*#__PURE__*/React.createElement("span", null, title)))) : null);
-}
-
-/***/ }),
-
-/***/ "./src/js/components/Tooltip.js":
-/*!**************************************!*\
- !*** ./src/js/components/Tooltip.js ***!
- \**************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ Tooltip)
-/* harmony export */ });
-/**
- * Render the Tooltip component.
- *
- * @return {JSX.Element} The Tooltip component.
- */
-function Tooltip() {
- return /*#__PURE__*/React.createElement("div", {
- id: "tooltip"
- });
-}
-
-/***/ }),
-
-/***/ "./src/js/components/cta/Extended.js":
-/*!*******************************************!*\
- !*** ./src/js/components/cta/Extended.js ***!
- \*******************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "ExtendedCTA": () => (/* binding */ ExtendedCTA),
-/* harmony export */ "ExtendedSearchCTA": () => (/* binding */ ExtendedSearchCTA)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js");
-function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
-function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
-function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
-
-
-
-
-/* eslint-disable */
-
-/**
- * Generic CTA for the Extended add-on.
- *
- * @return {JSX.Element} The ExtendedCTA component.
- */
-function ExtendedCTA() {
- var _instant_img_localize3, _instant_img_localize4;
- var _instant_img_localize = (_instant_img_localize3 = instant_img_localize) === null || _instant_img_localize3 === void 0 ? void 0 : (_instant_img_localize4 = _instant_img_localize3.addons) === null || _instant_img_localize4 === void 0 ? void 0 : _instant_img_localize4.extended,
- _instant_img_localize2 = _instant_img_localize.activated,
- activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2;
- var name = "extended-cta-2024";
- var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSetting)(name) === "hide"),
- _useState2 = _slicedToArray(_useState, 2),
- dissmissed = _useState2[0],
- setDismissed = _useState2[1]; // Get setting from localstorage.
-
- // Hide the CTA.
- function remove() {
- (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSettings)(name, "hide");
- setDismissed(true);
- }
- return /*#__PURE__*/React.createElement(React.Fragment, null, !activated && !dissmissed ? /*#__PURE__*/React.createElement("div", {
- className: "cta-extended cta-extended--standard"
- }, /*#__PURE__*/React.createElement("i", {
- className: "fa fa-bullhorn",
- "aria-hidden": "true"
- }), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("span", null, "Introducing the", " ", /*#__PURE__*/React.createElement("a", {
- href: "https://getinstantimages.com/add-ons/extended/",
- target: "_blank",
- rel: "noreferrer"
- }, "Extended add-on")), " ", "\u2192 An extension pack of premium features and functionality to enhance the Instant Images plugin."), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
- href: "https://getinstantimages.com/add-ons/extended/",
- target: "_blank",
- rel: "noreferrer",
- className: "button button-primary"
- }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Learn More", "instant-images")), /*#__PURE__*/React.createElement("button", {
- type: "button",
- className: "button button-secondary",
- onClick: function onClick() {
- return remove();
- },
- "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images")
- }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images")))) : null);
-}
-
-/**
- * CTA for the Extended add-on in the search dropdown.
- *
- * @param {Object} props The component props.
- * @param {boolean} props.show Display the component.
- * @return {JSX.Element} The ExtendedSearchCTA component.
- */
-function ExtendedSearchCTA(_ref) {
- var _ref$show = _ref.show,
- show = _ref$show === void 0 ? false : _ref$show;
- var name = "extended-cta-search-2024";
- var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSetting)(name) !== "hide"),
- _useState4 = _slicedToArray(_useState3, 2),
- active = _useState4[0],
- setActive = _useState4[1]; // Get setting from localstorage.
-
- // Hide the CTA.
- function remove() {
- (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSettings)(name, "hide");
- setActive(false);
- }
- return /*#__PURE__*/React.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("control-nav--search-history extended-cta", show && active ? "active" : null)
- }, /*#__PURE__*/React.createElement("div", {
- className: "cta-extended cta-extended--search"
- }, /*#__PURE__*/React.createElement("button", {
- type: "button",
- className: "closeBtn",
- onClick: function onClick() {
- return remove();
- },
- "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images")
- }, "\xD7", /*#__PURE__*/React.createElement("span", {
- className: "offscreen"
- }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Dismiss", "instant-images"))), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("i", {
- className: "fa fa-magic",
- "aria-hidden": "true"
- }), "Enable search suggestions, history, and maintain current search term while switching providers with the", " ", /*#__PURE__*/React.createElement("a", {
- href: "https://getinstantimages.com/add-ons/extended/",
- target: "_blank",
- rel: "noreferrer"
- }, "Extended add-on")), /*#__PURE__*/React.createElement("p", null, /*#__PURE__*/React.createElement("a", {
- href: "https://getinstantimages.com/add-ons/extended/",
- target: "_blank",
- rel: "noreferrer",
- className: "button button-primary"
- }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Learn More", "instant-images"))))));
-}
-
-/***/ }),
-
-/***/ "./src/js/components/search/SearchForm.js":
-/*!************************************************!*\
- !*** ./src/js/components/search/SearchForm.js ***!
- \************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js");
-/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js");
-/* harmony import */ var _hooks_useClickOutside__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../hooks/useClickOutside */ "./src/js/hooks/useClickOutside.js");
-/* harmony import */ var _cta_Extended__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../cta/Extended */ "./src/js/components/cta/Extended.js");
-/* harmony import */ var _SearchHistory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SearchHistory */ "./src/js/components/search/SearchHistory.js");
-/* harmony import */ var _SearchToolTip__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SearchToolTip */ "./src/js/components/search/SearchToolTip.js");
-function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
-function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
-function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
-
-
-
-
-
-
-
-
-
-/**
- * Render the search form as a component.
- *
- * @return {JSX.Element} The SearchForm component.
- */
-var SearchForm = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (_ref, ref) {
- var _instant_img_localize4, _instant_img_localize5;
- _objectDestructuringEmpty(_ref);
- var _instant_img_localize = (_instant_img_localize4 = instant_img_localize) === null || _instant_img_localize4 === void 0 ? void 0 : (_instant_img_localize5 = _instant_img_localize4.addons) === null || _instant_img_localize5 === void 0 ? void 0 : _instant_img_localize5.extended,
- _instant_img_localize2 = _instant_img_localize.activated,
- extended_activated = _instant_img_localize2 === void 0 ? false : _instant_img_localize2,
- _instant_img_localize3 = _instant_img_localize.license,
- extended_license = _instant_img_localize3 === void 0 ? false : _instant_img_localize3;
- var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(),
- searchHandler = _usePluginContext.searchHandler,
- apiError = _usePluginContext.apiError,
- suggestions = _usePluginContext.suggestions,
- getSuggestions = _usePluginContext.getSuggestions;
- var _useState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]),
- _useState2 = _slicedToArray(_useState, 2),
- history = _useState2[0],
- setHistory = _useState2[1];
- var _useState3 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
- _useState4 = _slicedToArray(_useState3, 2),
- show = _useState4[0],
- setShow = _useState4[1];
- var historyRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
- var submitBtnRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
-
- // Handle clickoutside hook.
- (0,_hooks_useClickOutside__WEBPACK_IMPORTED_MODULE_4__.useClickOutside)(historyRef, function () {
- setShow(false);
- });
-
- /**
- * Set the search value in the form.
- *
- * @param {string} value The value to set.
- */
- function setSearchValue(value) {
- var input = ref === null || ref === void 0 ? void 0 : ref.current;
- input.value = value;
- submitBtnRef === null || submitBtnRef === void 0 ? void 0 : submitBtnRef.current.click();
-
- // Set focus on input.
- input.focus();
- }
-
- /**
- * Search submit handler.
- *
- * @param {Event} e The event object.
- */
- function formSubmit(e) {
- var _ref$current;
- e.preventDefault();
- var term = ref === null || ref === void 0 ? void 0 : (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.value;
- if (term) {
- searchHandler(e);
- if (extended_license) {
- (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.saveSearchHistory)(term);
- setHistory((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSearchHistory)());
- }
- }
- }
-
- /**
- * Should the history div be shown?
- *
- * @return {boolean} Show history.
- */
- function showHistory() {
- return (history === null || history === void 0 ? void 0 : history.length) || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length);
- }
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- setHistory((0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_3__.getSearchHistory)());
- }, []);
- return /*#__PURE__*/React.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("control-nav--search", apiError ? "inactive" : null)
- }, /*#__PURE__*/React.createElement("form", {
- onSubmit: function onSubmit(e) {
- return formSubmit(e);
- },
- autoComplete: "off"
- }, /*#__PURE__*/React.createElement("label", {
- htmlFor: "search-input",
- className: "offscreen"
- }, instant_img_localize.search_label), /*#__PURE__*/React.createElement("div", {
- ref: historyRef
- }, /*#__PURE__*/React.createElement("input", {
- ref: ref,
- type: "text",
- id: "search-input",
- placeholder: instant_img_localize.search,
- disabled: apiError,
- onChange: function onChange(e) {
- return extended_license && getSuggestions(e.target.value);
- },
- onFocus: function onFocus() {
- return setShow(true);
- }
- }), extended_license && showHistory() ?
- /*#__PURE__*/
- /* Extended: Show only with valid add-on license */
- React.createElement(_SearchHistory__WEBPACK_IMPORTED_MODULE_6__["default"], {
- show: show,
- history: history,
- setHistory: setHistory,
- setSearchValue: setSearchValue,
- container: historyRef
- }) : null, !extended_activated &&
- /*#__PURE__*/
- /* Extended: Show only when add-on not installed. */
- React.createElement(_cta_Extended__WEBPACK_IMPORTED_MODULE_5__.ExtendedSearchCTA, {
- show: show
- })), /*#__PURE__*/React.createElement("button", {
- type: "submit",
- disabled: apiError,
- ref: submitBtnRef
- }, /*#__PURE__*/React.createElement("i", {
- className: "fa fa-search"
- }), /*#__PURE__*/React.createElement("span", {
- className: "offscreen"
- }, instant_img_localize.search)), /*#__PURE__*/React.createElement(_SearchToolTip__WEBPACK_IMPORTED_MODULE_7__["default"], {
- show: show
- })));
-});
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchForm);
-
-/***/ }),
-
-/***/ "./src/js/components/search/SearchHeader.js":
-/*!**************************************************!*\
- !*** ./src/js/components/search/SearchHeader.js ***!
- \**************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ SearchHeader)
-/* harmony export */ });
-/* harmony import */ var _constants_filters__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants/filters */ "./src/js/constants/filters.js");
-/* harmony import */ var _Filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Filter */ "./src/js/components/Filter.js");
-/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js");
-function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
-function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
-function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
-
-
-
-
-/**
- * Render the SearchHeader component.
- *
- * @return {JSX.Element} The SearchHeader component.
- */
-function SearchHeader() {
- var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_2__.usePluginContext)(),
- provider = _usePluginContext.provider,
- search = _usePluginContext.search,
- getPhotos = _usePluginContext.getPhotos,
- filterSearch = _usePluginContext.filterSearch;
- var _search$active = search.active,
- active = _search$active === void 0 ? false : _search$active,
- _search$term = search.term,
- term = _search$term === void 0 ? "" : _search$term,
- _search$results = search.results,
- total = _search$results === void 0 ? 0 : _search$results;
- var filters = _constants_filters__WEBPACK_IMPORTED_MODULE_0__.FILTERS[provider].search;
- if (!active) {
- // Exit if search is not active.
- return null;
- }
- return /*#__PURE__*/React.createElement("header", {
- className: "search-header"
- }, /*#__PURE__*/React.createElement("h2", null, term.replace("id:", "ID: ")), /*#__PURE__*/React.createElement("div", {
- className: "search-header--text"
- }, "".concat(total, " ").concat(instant_img_localize.search_results), " ", /*#__PURE__*/React.createElement("strong", null, "".concat(term)), /*#__PURE__*/React.createElement("span", null, "-"), /*#__PURE__*/React.createElement("button", {
- onClick: function onClick() {
- return getPhotos();
- }
- }, instant_img_localize.clear_search)), filters && Object.entries(filters).length && /*#__PURE__*/React.createElement("div", {
- className: "control-nav--filters-wrap"
- }, /*#__PURE__*/React.createElement("div", {
- className: "control-nav--filters"
- }, Object.entries(filters).map(function (_ref, index) {
- var _ref2 = _slicedToArray(_ref, 2),
- key = _ref2[0],
- filter = _ref2[1];
- return /*#__PURE__*/React.createElement(_Filter__WEBPACK_IMPORTED_MODULE_1__["default"], {
- key: "".concat(provider, "-search-").concat(key, "-").concat(index),
- filterKey: key,
- provider: provider,
- data: filter,
- handler: filterSearch
- });
- }))));
-}
-
-/***/ }),
-
-/***/ "./src/js/components/search/SearchHistory.js":
-/*!***************************************************!*\
- !*** ./src/js/components/search/SearchHistory.js ***!
- \***************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ SearchHistory)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js");
-/* harmony import */ var _functions_localStorage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../functions/localStorage */ "./src/js/functions/localStorage.js");
-/* harmony import */ var _hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../hooks/useArrowControls */ "./src/js/hooks/useArrowControls.js");
-
-
-
-
-
-
-
-/**
- * The History list component.
- *
- * @param {Object} props The component props.
- * @return {JSX.Element} The SearchHistory component.
- */
-function SearchHistory(props) {
- var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_3__.usePluginContext)(),
- suggestions = _usePluginContext.suggestions;
- var show = props.show,
- history = props.history,
- setHistory = props.setHistory,
- setSearchValue = props.setSearchValue,
- container = props.container;
- var dropRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
-
- // Use up/down arrow keys to navigate dropdown.
- (0,_hooks_useArrowControls__WEBPACK_IMPORTED_MODULE_5__.useArrowControls)(show, container);
- return /*#__PURE__*/React.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_2___default()("control-nav--search-history", show ? "active" : null),
- role: "listbox",
- ref: dropRef
- }, !!suggestions.length && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", {
- className: "control-nav--search-history-title"
- }, /*#__PURE__*/React.createElement("div", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Suggestions", "instant-images"))), /*#__PURE__*/React.createElement("ul", {
- role: "listbox",
- className: "search-suggestions"
- }, suggestions.map(function (item, key) {
- return /*#__PURE__*/React.createElement("li", {
- key: key,
- role: "option"
- }, /*#__PURE__*/React.createElement("button", {
- type: "button",
- onClick: function onClick() {
- return setSearchValue(item);
- }
- }, item));
- }))), !!history.length && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("div", {
- className: "control-nav--search-history-title"
- }, /*#__PURE__*/React.createElement("div", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Recent Searches", "instant-images")), /*#__PURE__*/React.createElement("button", {
- type: "button",
- onClick: function onClick() {
- (0,_functions_localStorage__WEBPACK_IMPORTED_MODULE_4__.clearSearchHistory)();
- setHistory([]);
- }
- }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Clear", "instant-images"))), /*#__PURE__*/React.createElement("ul", {
- role: "listbox",
- className: "search-history"
- }, history.map(function (item, key) {
- return /*#__PURE__*/React.createElement("li", {
- key: key,
- role: "option"
- }, /*#__PURE__*/React.createElement("button", {
- type: "button",
- className: "history",
- onClick: function onClick() {
- return setSearchValue(item);
- }
- }, item));
- }))));
-}
-
-/***/ }),
-
-/***/ "./src/js/components/search/SearchToolTip.js":
-/*!***************************************************!*\
- !*** ./src/js/components/search/SearchToolTip.js ***!
- \***************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ SearchToolTip)
-/* harmony export */ });
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../common/pluginProvider */ "./src/js/common/pluginProvider.js");
-
-
-
-/**
- * Render the search results tooltip component.
- *
- * @return {JSX.Element} The SearchToolTip component.
- */
-function SearchToolTip() {
- var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(),
- getPhotos = _usePluginContext.getPhotos,
- search = _usePluginContext.search;
- return /*#__PURE__*/React.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_0___default()("control-nav--search-tooltip", search !== null && search !== void 0 && search.active ? null : "hide")
- }, /*#__PURE__*/React.createElement("span", {
- title: "".concat(search === null || search === void 0 ? void 0 : search.results, " ").concat(instant_img_localize.search_results, " ").concat(search === null || search === void 0 ? void 0 : search.term)
- }, search === null || search === void 0 ? void 0 : search.results), /*#__PURE__*/React.createElement("button", {
- type: "button",
- title: instant_img_localize.clear_search,
- onClick: function onClick() {
- return getPhotos(true);
- }
- }, "x", /*#__PURE__*/React.createElement("span", {
- className: "offscreen"
- }, instant_img_localize.clear_search)));
-}
-
-/***/ }),
-
-/***/ "./src/js/constants/API.js":
-/*!*********************************!*\
- !*** ./src/js/constants/API.js ***!
- \*********************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "API": () => (/* binding */ API)
-/* harmony export */ });
-/* harmony import */ var _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../components/ProviderIcons */ "./src/js/components/ProviderIcons.js");
-
-var API = {
- proxy: "https://proxy.getinstantimages.com/api/" || 0,
- // eslint-disable-line
- testmode: false,
- defaults: {
- provider: "unsplash",
- order: "latest",
- per_page: "20",
- arr_key: "results"
- },
- providers: ["Unsplash", "Openverse", "Pixabay", "Pexels"],
- unsplash: {
- name: "Unsplash",
- requires_key: true,
- "new": false,
- api_var: "client_id",
- collections_api: "https://api.unsplash.com/collections/",
- icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.UnsplashIcon
- },
- pixabay: {
- name: "Pixabay",
- requires_key: true,
- "new": false,
- api_var: "key",
- icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.PixabayIcon
- },
- pexels: {
- name: "Pexels",
- requires_key: true,
- "new": false,
- api_var: "key",
- icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.PexelsIcon
- },
- openverse: {
- name: "Openverse",
- requires_key: false,
- "new": false,
- api_var: "key",
- key: "",
- icon: _components_ProviderIcons__WEBPACK_IMPORTED_MODULE_0__.OpenverseIcon
- }
-};
-
-/***/ }),
-
-/***/ "./src/js/constants/filters.js":
-/*!*************************************!*\
- !*** ./src/js/constants/filters.js ***!
- \*************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "FILTERS": () => (/* binding */ FILTERS)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _filters_openverse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filters/openverse */ "./src/js/constants/filters/openverse.js");
-/* harmony import */ var _filters_pexels__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filters/pexels */ "./src/js/constants/filters/pexels.js");
-/* harmony import */ var _filters_pixabay__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filters/pixabay */ "./src/js/constants/filters/pixabay.js");
-/* harmony import */ var _filters_unsplash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./filters/unsplash */ "./src/js/constants/filters/unsplash.js");
-function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
-function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
-function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-
-
-
-
-
-var ALL = {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("All", "instant-images"),
- value: "all"
-};
-var FILTERS = {
- openverse: {
- filters: {
- source: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Source", "instant-images"),
- "default": "wordpress",
- filters: _toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_SOURCES)
- },
- aspect_ratio: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_ORIENTATIONS))
- }
- },
- search: {
- category: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"),
- "default": "all",
- filters: [ALL, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Illustration", "instant-images"),
- value: "illustration"
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Photograph", "instant-images"),
- value: "photograph"
- }]
- },
- extension: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Extension", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_EXTENSIONS))
- },
- aspect_ratio: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_ORIENTATIONS))
- },
- size: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Size", "instant-images"),
- "default": "all",
- filters: [ALL, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Large", "instant-images"),
- value: "large"
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Medium", "instant-images"),
- value: "medium"
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Small", "instant-images"),
- value: "small"
- }]
- },
- license: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("License", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_openverse__WEBPACK_IMPORTED_MODULE_1__.OPENVERSE_LICENSES))
- },
- license_type: {
- label: "license_type",
- "default": "all",
- filters: [ALL, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Commercial", "instant-images"),
- value: "commercial"
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Modification", "instant-images"),
- value: "modification"
- }]
- }
- }
- },
- pexels: {
- filters: {
- order_by: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"),
- "default": "curated",
- filters: [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Curated", "instant-images"),
- value: "curated"
- }]
- }
- },
- search: {
- orientation: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_pexels__WEBPACK_IMPORTED_MODULE_2__.PEXELS_ORIENTATIONS))
- },
- color: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_pexels__WEBPACK_IMPORTED_MODULE_2__.PEXELS_COLORS))
- },
- size: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Size", "instant-images"),
- "default": "all",
- filters: [ALL, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Large", "instant-images"),
- value: "large"
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Medium", "instant-images"),
- value: "medium"
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Small", "instant-images"),
- value: "small"
- }]
- }
- }
- },
- unsplash: {
- filters: {
- order_by: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"),
- "default": "latest",
- filters: [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"),
- value: "latest"
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Popular", "instant-images"),
- value: "popular"
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Oldest", "instant-images"),
- value: "oldest"
- }]
- }
- },
- search: {
- order_by: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"),
- "default": "relevance",
- filters: [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Relevance", "instant-images"),
- value: "relevance"
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"),
- value: "latest"
- }]
- },
- orientation: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_unsplash__WEBPACK_IMPORTED_MODULE_4__.UNSPLASH_ORIENTATIONS))
- },
- color: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_unsplash__WEBPACK_IMPORTED_MODULE_4__.UNSPLASH_COLORS))
- }
- }
- },
- pixabay: {
- filters: {
- order: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Order", "instant-images"),
- "default": "popular",
- filters: [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Popular", "instant-images"),
- value: "popular"
- }, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Latest", "instant-images"),
- value: "latest"
- }]
- },
- image_type: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_IMAGE_TYPE))
- },
- category: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Category", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_CATS))
- },
- colors: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_COLORS))
- },
- orientation: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_ORIENTATIONS))
- }
- },
- search: {
- image_type: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Type", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_IMAGE_TYPE))
- },
- colors: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Colors", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_COLORS))
- },
- orientation: {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orientation", "instant-images"),
- "default": "all",
- filters: [ALL].concat(_toConsumableArray(_filters_pixabay__WEBPACK_IMPORTED_MODULE_3__.PIXABAY_ORIENTATIONS))
- }
- }
- }
-};
-
-/***/ }),
-
-/***/ "./src/js/constants/filters/openverse.js":
-/*!***********************************************!*\
- !*** ./src/js/constants/filters/openverse.js ***!
- \***********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "OPENVERSE_EXTENSIONS": () => (/* binding */ OPENVERSE_EXTENSIONS),
-/* harmony export */ "OPENVERSE_LICENSES": () => (/* binding */ OPENVERSE_LICENSES),
-/* harmony export */ "OPENVERSE_ORIENTATIONS": () => (/* binding */ OPENVERSE_ORIENTATIONS),
-/* harmony export */ "OPENVERSE_SOURCES": () => (/* binding */ OPENVERSE_SOURCES)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-
-var OPENVERSE_SOURCES = [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("WordPress", "instant-images"),
- value: "wordpress"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Flickr", "instant-images"),
- value: "flickr"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Nasa", "instant-images"),
- value: "nasa"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("SpaceX", "instant-images"),
- value: "spacex"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Wikimedia", "instant-images"),
- value: "wikimedia"
-}];
-var OPENVERSE_ORIENTATIONS = [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"),
- value: "square"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Tall", "instant-images"),
- value: "tall"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Wide", "instant-images"),
- value: "wide"
-}];
-var OPENVERSE_EXTENSIONS = [{
- label: "JPG",
- value: "JPG"
-}, {
- label: "GIF",
- value: "GIF"
-}, {
- label: "PNG",
- value: "PNG"
-}, {
- label: "SVG",
- value: "SVG"
-}];
-var OPENVERSE_LICENSES = [{
- label: "BY",
- value: "BY"
-}, {
- label: "BY-NC",
- value: "BY-NC"
-}, {
- label: "BY-NC-ND",
- value: "BY-NC-ND"
-}, {
- label: "BY-NC-SA",
- value: "BY-NC-SA"
-}, {
- label: "BY-ND",
- value: "BY-ND"
-}, {
- label: "BY-SA",
- value: "BY-SA"
-}, {
- label: "CC0",
- value: "CC0"
-}];
-
-/***/ }),
-
-/***/ "./src/js/constants/filters/pexels.js":
-/*!********************************************!*\
- !*** ./src/js/constants/filters/pexels.js ***!
- \********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "PEXELS_COLORS": () => (/* binding */ PEXELS_COLORS),
-/* harmony export */ "PEXELS_ORIENTATIONS": () => (/* binding */ PEXELS_ORIENTATIONS)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-
-var PEXELS_COLORS = [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"),
- value: "red"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"),
- value: "orange"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"),
- value: "yellow"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"),
- value: "green"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Turquoise", "instant-images"),
- value: "turquoise"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"),
- value: "blue"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Violet", "instant-images"),
- value: "violet"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Pink", "instant-images"),
- value: "pink"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Brown", "instant-images"),
- value: "brown"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"),
- value: "black"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Gray", "instant-images"),
- value: "gray"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"),
- value: "white"
-}];
-var PEXELS_ORIENTATIONS = [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Landscape", "instant-images"),
- value: "landscape"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Portrait", "instant-images"),
- value: "portrait"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"),
- value: "squarish"
-}];
-
-/***/ }),
-
-/***/ "./src/js/constants/filters/pixabay.js":
-/*!*********************************************!*\
- !*** ./src/js/constants/filters/pixabay.js ***!
- \*********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "PIXABAY_CATS": () => (/* binding */ PIXABAY_CATS),
-/* harmony export */ "PIXABAY_COLORS": () => (/* binding */ PIXABAY_COLORS),
-/* harmony export */ "PIXABAY_IMAGE_TYPE": () => (/* binding */ PIXABAY_IMAGE_TYPE),
-/* harmony export */ "PIXABAY_ORIENTATIONS": () => (/* binding */ PIXABAY_ORIENTATIONS)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-
-var PIXABAY_COLORS = [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Grayscale", "instant-images"),
- value: "grayscale"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"),
- value: "red"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"),
- value: "orange"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"),
- value: "yellow"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"),
- value: "green"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Turquoise", "instant-images"),
- value: "turquoise"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"),
- value: "blue"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Lilac", "instant-images"),
- value: "lilac"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Pink", "instant-images"),
- value: "pink"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"),
- value: "white"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Gray", "instant-images"),
- value: "gray"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"),
- value: "black"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Brown", "instant-images"),
- value: "brown"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Transparent", "instant-images"),
- value: "transparent"
-}];
-var PIXABAY_CATS = [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Backgrounds", "instant-images"),
- value: "backgrounds"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Fashion", "instant-images"),
- value: "fashion"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Nature", "instant-images"),
- value: "nature"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Science", "instant-images"),
- value: "science"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Education", "instant-images"),
- value: "education"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Feelings", "instant-images"),
- value: "feelings"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Health", "instant-images"),
- value: "health"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("People", "instant-images"),
- value: "people"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Religion", "instant-images"),
- value: "religion"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Places", "instant-images"),
- value: "places"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Animals", "instant-images"),
- value: "animals"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Industry", "instant-images"),
- value: "industry"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Computer", "instant-images"),
- value: "computer"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Food", "instant-images"),
- value: "food"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Sports", "instant-images"),
- value: "sports"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Food", "instant-images"),
- value: "food"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Transportation", "instant-images"),
- value: "transportation"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Travel", "instant-images"),
- value: "travel"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Buildings", "instant-images"),
- value: "buildings"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Business", "instant-images"),
- value: "business"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Music", "instant-images"),
- value: "music"
-}];
-var PIXABAY_ORIENTATIONS = [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Horizontal", "instant-images"),
- value: "horizontal"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Vertical", "instant-images"),
- value: "vertical"
-}];
-var PIXABAY_IMAGE_TYPE = [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Photo", "instant-images"),
- value: "photo"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Illustration", "instant-images"),
- value: "illustration"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Vector", "instant-images"),
- value: "vector"
-}];
-
-/***/ }),
-
-/***/ "./src/js/constants/filters/unsplash.js":
-/*!**********************************************!*\
- !*** ./src/js/constants/filters/unsplash.js ***!
- \**********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "UNSPLASH_COLORS": () => (/* binding */ UNSPLASH_COLORS),
-/* harmony export */ "UNSPLASH_ORIENTATIONS": () => (/* binding */ UNSPLASH_ORIENTATIONS)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-
-var UNSPLASH_COLORS = [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black & White", "instant-images"),
- value: "black_and_white"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Black", "instant-images"),
- value: "black"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("White", "instant-images"),
- value: "white"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Yellow", "instant-images"),
- value: "yellow"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Green", "instant-images"),
- value: "green"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Orange", "instant-images"),
- value: "orange"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Red", "instant-images"),
- value: "red"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Purple", "instant-images"),
- value: "purple"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Magenta", "instant-images"),
- value: "magenta"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Teal", "instant-images"),
- value: "teal"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Blue", "instant-images"),
- value: "blue"
-}];
-var UNSPLASH_ORIENTATIONS = [{
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Landscape", "instant-images"),
- value: "landscape"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Portrait", "instant-images"),
- value: "portrait"
-}, {
- label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Square", "instant-images"),
- value: "squarish"
-}];
-
-/***/ }),
-
-/***/ "./src/js/editor/block/components/Header.js":
-/*!**************************************************!*\
- !*** ./src/js/editor/block/components/Header.js ***!
- \**************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ BlockHeader)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../common/pluginProvider */ "./src/js/common/pluginProvider.js");
-/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../constants/API */ "./src/js/constants/API.js");
-/* harmony import */ var _components_Icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../components/Icon */ "./src/js/components/Icon.js");
-
-
-
-
-var providers = _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.providers;
-
-/**
- * Render the block header.
- *
- * @param {Object} props The component props.
- * @param {Object} props.switchProvider The function to switch the provider.
- * @return {JSX.Element} The BlockHeader component.
- */
-function BlockHeader(_ref) {
- var switchProvider = _ref.switchProvider;
- var _usePluginContext = (0,_common_pluginProvider__WEBPACK_IMPORTED_MODULE_1__.usePluginContext)(),
- provider = _usePluginContext.provider;
-
- /**
- * Switch the provider via select.
- *
- * @param {string} value The provider value.
- */
- function providerChange(value) {
- if (value) {
- switchProvider(value);
- }
- }
- return /*#__PURE__*/React.createElement("div", {
- className: "instant-images-block--header"
- }, /*#__PURE__*/React.createElement("div", {
- className: "instant-images-block--header-logo"
- }, /*#__PURE__*/React.createElement(_components_Icon__WEBPACK_IMPORTED_MODULE_3__.IconLogo, null), /*#__PURE__*/React.createElement("span", null, "Instant Images")), /*#__PURE__*/React.createElement("div", {
- className: "instant-images-block--header-nav"
- }, /*#__PURE__*/React.createElement("label", {
- className: "offscreen"
- }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Select Provider", "instant-images")), /*#__PURE__*/React.createElement("select", {
- defaultValue: provider,
- onChange: function onChange(e) {
- return providerChange(e.target.value);
- }
- }, /*#__PURE__*/React.createElement("option", {
- value: ""
- }, "-- ", (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Select Provider", "instant-images"), " --"), providers.map(function (item, index) {
- return /*#__PURE__*/React.createElement("option", {
- key: index,
- value: item.toLowerCase()
- }, item);
- }))));
-}
-
-/***/ }),
-
-/***/ "./src/js/editor/block/components/Instructions.js":
-/*!********************************************************!*\
- !*** ./src/js/editor/block/components/Instructions.js ***!
- \********************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ BlockInstructions)
-/* harmony export */ });
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
-/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
-
-
-/**
- * Render instructional text for the WP Block.
- *
- * @param {Object} props The component props.
- * @return {JSX.Element} The BlockInstructions component.
- */
-function BlockInstructions(props) {
- var _props$show = props.show,
- show = _props$show === void 0 ? false : _props$show;
- if (!show) {
- return null;
- }
- return /*#__PURE__*/React.createElement("div", {
- className: "instant-images-block--instructions"
- }, /*#__PURE__*/React.createElement("span", null, "\u2190"), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("Scroll to Load Images", "instant-images"), /*#__PURE__*/React.createElement("span", null, "\u2192"));
-}
-
-/***/ }),
-
-/***/ "./src/js/editor/block/components/LoadMore.js":
-/*!****************************************************!*\
- !*** ./src/js/editor/block/components/LoadMore.js ***!
- \****************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
-/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
-
-
-
-/**
- * Render the BlockLoadMore component.
- *
- * @return {JSX.Element} The BlockLoadMore component.
- */
-var BlockLoadMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
- var done = props.done;
- return /*#__PURE__*/React.createElement("div", {
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("instant-images-block--loader", done ? "done" : null),
- ref: ref
- });
-});
-/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BlockLoadMore);
-
-/***/ }),
-
-/***/ "./src/js/editor/utils/insertImage.js":
-/*!********************************************!*\
- !*** ./src/js/editor/utils/insertImage.js ***!
- \********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ insertImage)
-/* harmony export */ });
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks");
-/* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_1__);
-
-
-
-/**
- * Insert an image block into the block editor.
- *
- * @param {Object} attachment The attachment object.
- * @param {string} clientId The block ID.
- */
-function insertImage(attachment, clientId) {
- var _attachment$id = attachment.id,
- id = _attachment$id === void 0 ? null : _attachment$id,
- _attachment$url = attachment.url,
- url = _attachment$url === void 0 ? null : _attachment$url,
- _attachment$caption = attachment.caption,
- caption = _attachment$caption === void 0 ? "" : _attachment$caption,
- _attachment$alt = attachment.alt,
- alt = _attachment$alt === void 0 ? "" : _attachment$alt;
- if (!url || !id) {
- return;
- }
-
- // Create block.
- var block = (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.createBlock)("core/image", {
- id: id,
- url: url,
- caption: caption,
- alt: alt
- });
- if (clientId) {
- // Replace the Instant Images block.
- (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)("core/block-editor").replaceBlock(clientId, block);
- } else {
- // Insert Image block.
- (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__.dispatch)("core/block-editor").insertBlocks(block);
- }
-}
-
-/***/ }),
-
-/***/ "./src/js/editor/utils/setFeaturedImage.js":
-/*!*************************************************!*\
- !*** ./src/js/editor/utils/setFeaturedImage.js ***!
- \*************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ setFeaturedImage)
-/* harmony export */ });
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");
-/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_0__);
-
-
-/**
- * Set image as featured image in Gutenberg.
- *
- * @param {Object} attachment The attachment object.
- */
-function setFeaturedImage(attachment) {
- var _attachment$id = attachment.id,
- id = _attachment$id === void 0 ? null : _attachment$id;
- if (!id) {
- return;
- }
-
- // Set the featured image.
- (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)("core/editor").editPost({
- featured_media: id
- });
-
- // Open the document sidebar.
- (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__.dispatch)("core/edit-post").openGeneralSidebar("edit-post/document");
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/buildURL.js":
-/*!**************************************!*\
- !*** ./src/js/functions/buildURL.js ***!
- \**************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "buildTestURL": () => (/* binding */ buildTestURL),
-/* harmony export */ "default": () => (/* binding */ buildURL),
-/* harmony export */ "getProxyURL": () => (/* binding */ getProxyURL)
-/* harmony export */ });
-/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js");
-/* harmony import */ var _getQueryParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getQueryParams */ "./src/js/functions/getQueryParams.js");
-/* harmony import */ var _providers_openverse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./providers/openverse */ "./src/js/functions/providers/openverse.js");
-function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
-function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
-function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
-
-
-
-
-/**
- * Build the API query parameters.
- *
- * @param {string} type The query type (search, photos, id).
- * @param {Object} params The current params object.
- * @return {string} The new API URL with querystring params.
- */
-function buildURL(type, params) {
- if (!type) {
- // Bail early if API query type is missing.
- return "";
- }
- // Get the current provider.
- var _params = params,
- _params$provider = _params.provider,
- provider = _params$provider === void 0 ? "unsplash" : _params$provider;
-
- // Provider doesn't need to be sent.
- delete params.provider;
-
- // Set Openverse params.
- params = provider === "openverse" ? (0,_providers_openverse__WEBPACK_IMPORTED_MODULE_2__.openverseParams)(type, params) : params;
-
- // Build the API URL.
- var url = new URL(getProxyURL(provider));
-
- // Add `type` to params.
- url.searchParams.append("type", type);
-
- // Append query params.
- Object.keys(params).forEach(function (key) {
- url.searchParams.append(key, params[key]);
- });
-
- // Add `version` to params.
- url.searchParams.append("version", instant_img_localize.version);
- return url === null || url === void 0 ? void 0 : url.href;
-}
-
-/**
- * Get the proxy URL from ENV vars.
- *
- * @param {string} provider The image provider.
- * @return {string} The proxy URL.
- */
-function getProxyURL(provider) {
- var _API$proxy = _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.proxy,
- proxy = _API$proxy === void 0 ? "https://proxy.getinstantimages.com/api/" : _API$proxy;
- return "".concat(proxy).concat(provider);
-}
-
-/**
- * Build a API testing URL.
- *
- * @param {string} provider The current service provider.
- * @return {string} The API URL.
- */
-function buildTestURL(provider) {
- var options = {
- per_page: 5,
- page: 1
- };
-
- // Build URL.
- var params = _objectSpread(_objectSpread({
- test: true
- }, (0,_getQueryParams__WEBPACK_IMPORTED_MODULE_1__["default"])(provider)), options);
- return buildURL("photos", params);
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/consoleStatus.js":
-/*!*******************************************!*\
- !*** ./src/js/functions/consoleStatus.js ***!
- \*******************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ consoleStatus)
-/* harmony export */ });
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js");
-/* harmony import */ var _getErrorMessage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getErrorMessage */ "./src/js/functions/getErrorMessage.js");
-
-
-
-/**
- * Display a console.warn message about API status.
- *
- * @param {string} provider The API service provider.
- * @param {string} status The API status.
- */
-function consoleStatus(provider) {
- var status = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
- var local = instant_img_localize;
- var message = (0,_getErrorMessage__WEBPACK_IMPORTED_MODULE_1__["default"])(status);
- switch (status) {
- case 400:
- case 401:
- case 500:
- // Unsplash/Pixabay/Pexels incorrect API key
- console.warn("[".concat(local.instant_images, " - ").concat(status, " Error] ").concat((0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider), ": ").concat(message));
- break;
- case 429:
- /**
- * Pixabay, Pexels - too many requests.
- *
- * @see https://www.pexels.com/api/documentation/#statistics
- * @see https://pixabay.com/api/docs/#api_rate_limit
- */
- console.warn("[".concat(local.instant_images, " - ").concat(status, " Error] ").concat((0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider), ": ").concat(message));
- break;
- default:
- break;
- }
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/generateAttribution.js":
-/*!*************************************************!*\
- !*** ./src/js/functions/generateAttribution.js ***!
- \*************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ generateAttribution)
-/* harmony export */ });
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js");
-
-
-/**
- * Get the API URL for searches by ID.
- *
- * @param {string} text Attribution hook content.
- * @param {string} provider Image provider.
- * @param {string} permalink Image url.
- * @param {Object} user The user data.
- * @return {string} The raw attribution HTML.
- */
-function generateAttribution(text, provider, permalink, user) {
- if (!text || !provider || !permalink || !user) {
- return text;
- }
-
- // Get user data.
- var username = user.name,
- user_url = user.url;
-
- // Format provider data.
- var provider_url = instant_img_localize["".concat(provider, "_url")];
- var provider_name = (0,_helpers__WEBPACK_IMPORTED_MODULE_0__.capitalizeFirstLetter)(provider);
-
- // Generate attribution template.
- var attribution = text;
- attribution = attribution.replace("{username}", username);
- attribution = attribution.replace("{user_url}", user_url);
- attribution = attribution.replace("{image_url}", permalink);
- attribution = attribution.replace("{provider_url}", provider_url);
- attribution = attribution.replace("{provider}", provider_name);
- return attribution;
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/getErrorMessage.js":
-/*!*********************************************!*\
- !*** ./src/js/functions/getErrorMessage.js ***!
- \*********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ getErrorMessage)
-/* harmony export */ });
-/**
- * Get the correct error message by status code.
- *
- * @param {string} status The API status.
- */
-function getErrorMessage() {
- var status = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 200;
- var local = instant_img_localize;
- switch (status) {
- case 400:
- case 401:
- // Unsplash/Pixabay/Pexels incorrect API key.
- return local.api_invalid_msg;
- case 403:
- return local.api_invalid_403_msg;
- case 404:
- return local.api_invalid_404_msg;
- case 429:
- /**
- * Pixabay, Pexels - too many requests.
- *
- * @see https://www.pexels.com/api/documentation/#statistics
- * @see https://pixabay.com/api/docs/#api_rate_limit
- */
- return local.api_ratelimit_msg;
- case 500:
- case 503:
- // Internal server error.
- return local.api_invalid_500_msg;
- case 501:
- // Missing params.
- return local.api_invalid_501_msg;
- default:
- break;
- }
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/getProvider.js":
-/*!*****************************************!*\
- !*** ./src/js/functions/getProvider.js ***!
- \*****************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ getProvider)
-/* harmony export */ });
-/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js");
-
-
-/**
- * Get the default provider on page load.
- *
- * @return {string} The default service provider.
- */
-function getProvider() {
- return instant_img_localize && instant_img_localize.default_provider ? instant_img_localize.default_provider : _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.provider;
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/getQueryParams.js":
-/*!********************************************!*\
- !*** ./src/js/functions/getQueryParams.js ***!
- \********************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ getQueryParams),
-/* harmony export */ "getAuth": () => (/* binding */ getAuth),
-/* harmony export */ "getContentSafety": () => (/* binding */ getContentSafety)
-/* harmony export */ });
-/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js");
-function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
-function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
-function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
-
-
-// eslint-disable
-
-/**
- * Build the API query parameters
- *
- * @param {string} provider The current service provider.
- * @param {Object} queryParams Optional query parameters to append to base params.
- * @return {Object} Parameters used for the fetch request.
- */
-function getQueryParams(provider, queryParams) {
- if (!provider) {
- return {};
- }
-
- // Construct per page amount.
- var per_page = queryParams && queryParams.id ? 1 : _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.per_page;
-
- // Set default params.
- var params = {
- provider: provider,
- per_page: per_page
- };
-
- // Append additional params.
- params = getContentSafety(params, provider);
- params = _objectSpread(_objectSpread({}, params), queryParams);
- params = getAuth(params, provider);
-
- /**
- * Display query params in the browser console.
- *
- * Global plugin hook.
- */
- if (instant_img_localize.query_debug) {
- console.table(params);
- }
- return params;
-}
-
-/**
- * Get auth keys and append to API query request.
- *
- * @param {Object} params The current params object.
- * @param {string} provider The current service provider.
- * @return {Object} The auth parameter object.
- */
-function getAuth(params, provider) {
- var has_auth = _constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider].requires_key;
- if (!has_auth || !provider) {
- return params;
- }
- var app_id = instant_img_localize["".concat(provider, "_app_id")];
- if (app_id) {
- // Pass API keys if not using defaults.
- params[_constants_API__WEBPACK_IMPORTED_MODULE_0__.API[provider].api_var] = app_id;
- }
- return params;
-}
-
-/**
- * Set the photo safety for indicating that only images suitable for all ages should be returned.
- *
- * @see https://unsplash.com/documentation#content-safety
- * @see https://pixabay.com/api/docs/
- *
- * @param {Object} params The current params object.
- * @param {string} provider The current service provider.
- * @return {Object} The fetch parameters object.
- */
-function getContentSafety(params, provider) {
- switch (provider) {
- case "unsplash":
- if (instant_img_localize.unsplash_content_filter) {
- params.content_filter = instant_img_localize.unsplash_content_filter;
- }
- break;
- case "pixabay":
- if (instant_img_localize.pixabay_safesearch) {
- params.safesearch = "true";
- }
- break;
- case "openverse":
- if (instant_img_localize.openverse_mature) {
- params.mature = "true";
- }
- break;
- }
- return params;
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/getResults.js":
-/*!****************************************!*\
- !*** ./src/js/functions/getResults.js ***!
- \****************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ getResults),
-/* harmony export */ "getResultById": () => (/* binding */ getResultById),
-/* harmony export */ "getSearchTotal": () => (/* binding */ getSearchTotal)
-/* harmony export */ });
-/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js");
-
-
-/**
- * Pluck `results` from the API response.
- *
- * @param {Object} data The API results object.
- * @return {Array} The results as an array.
- */
-function getResults(data) {
- if (!data) {
- return [];
- }
- var results = data[_constants_API__WEBPACK_IMPORTED_MODULE_0__.API.defaults.arr_key] || [];
- return results;
-}
-
-/**
- * Get the total search results.
- *
- * @param {Object} data The search data object.
- * @return {string} The total results.
- */
-function getSearchTotal(data) {
- // Return 0 if undefined or null.
- return data.total === undefined || data.total === null ? 0 : data.total;
-}
-
-/**
- * Get results by photo ID.
- *
- * @param {string} provider The current service provider.
- * @param {string} key The match key to access.
- * @param {Object} data The API results object.
- * @return {Array} The results as an array.
- * @deprecated 5.0
- */
-function getResultById(provider, key, data) {
- if (!data) {
- return [];
- }
- var result = [];
- switch (provider) {
- case "unsplash":
- case "pexels":
- result = data || [];
- break;
- case "pixabay":
- result = data[key] && data[key][0] ? data[key][0] : [];
- break;
- }
- return result;
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/helpers.js":
-/*!*************************************!*\
- !*** ./src/js/functions/helpers.js ***!
- \*************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "capitalizeFirstLetter": () => (/* binding */ capitalizeFirstLetter),
-/* harmony export */ "checkRateLimit": () => (/* binding */ checkRateLimit),
-/* harmony export */ "gotoURL": () => (/* binding */ gotoURL),
-/* harmony export */ "hideTooltip": () => (/* binding */ hideTooltip),
-/* harmony export */ "isObjectEmpty": () => (/* binding */ isObjectEmpty),
-/* harmony export */ "md5Hash": () => (/* binding */ md5Hash),
-/* harmony export */ "showTooltip": () => (/* binding */ showTooltip)
-/* harmony export */ });
-/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! crypto-js */ "./node_modules/crypto-js/index.js");
-/* harmony import */ var crypto_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(crypto_js__WEBPACK_IMPORTED_MODULE_0__);
-
-
-/**
- * Get the MD5 hash value of a URL.
- *
- * @param {string} url The API URL to hash.
- * @return {string} The MD5 hash.
- */
-function md5Hash(url) {
- return crypto_js__WEBPACK_IMPORTED_MODULE_0___default().MD5(url).toString();
-}
-
-/**
- * Check if an object is empty.
- *
- * @param {Object} obj The object to test against.
- * @return {boolean} Is this an object.
- */
-function isObjectEmpty(obj) {
- if (obj === null || obj === undefined) {
- return true;
- }
- return Object.keys(obj).length === 0;
-}
-
-/**
- * Check the `x-ratelimit-remaining` headers to confirm the API is available.
- *
- * @param {Object} headers The request headers object.
- */
-function checkRateLimit(headers) {
- if (!headers) {
- return;
- }
- var limit = headers.get("X-RateLimit-Limit") || -1;
- var remaining = headers.get("X-RateLimit-Remaining") || -1;
- if (limit > -1 && parseInt(remaining) < 2) {
- alert(instant_img_localize.api_ratelimit_msg); // eslint-disable-line
- }
-}
-
-/**
- * Capitalize the first letter of a string.
- *
- * @param {string} str The string to format.
- * @return {string} The formatted string.
- */
-function capitalizeFirstLetter(str) {
- return str.charAt(0).toUpperCase() + str.slice(1);
-}
-var tooltipInterval = "";
-
-/**
- * Show the tooltip.
- *
- * @param {Event} e The target tooltip element.
- * @since 4.3.0
- */
-function showTooltip(e) {
- var target = e.currentTarget;
- var rect = target.getBoundingClientRect();
- var left = Math.round(rect.left);
- var top = Math.round(rect.top);
- var container = target.closest("#photo-listing");
- var tooltip = container.querySelector("#tooltip");
- tooltip.classList.remove("over");
- if (target.classList.contains("tooltip--above")) {
- tooltip.classList.add("above");
- } else {
- tooltip.classList.remove("above");
- }
-
- // Delay Tooltip Reveal.
- tooltipInterval = setInterval(function () {
- clearInterval(tooltipInterval);
- tooltip.innerHTML = target.dataset.title; // Tooltip content.
-
- // Position Tooltip.
- left = left - tooltip.offsetWidth + target.offsetWidth + 5;
- tooltip.style.left = "".concat(left, "px");
- tooltip.style.top = "".concat(top, "px");
- setTimeout(function () {
- tooltip.classList.add("over");
- }, 25);
- }, 750);
-}
-
-/**
- * Hide the tooltip.
- *
- * @param {Event} e The target tooltip element.
- * @since 4.3.0
- */
-function hideTooltip(e) {
- clearInterval(tooltipInterval);
- var container = e.currentTarget.closest("#photo-listing");
- var tooltip = container.querySelector("#tooltip");
- tooltip.classList.remove("over");
-}
-
-/**
- * Open the URL in new window.
- *
- * @param {string} url The destination URL.
- */
-function gotoURL(url) {
- if (url && window) {
- window.open(url, "_blank");
- }
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/localStorage.js":
-/*!******************************************!*\
- !*** ./src/js/functions/localStorage.js ***!
- \******************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "clearSearchHistory": () => (/* binding */ clearSearchHistory),
-/* harmony export */ "getSearchHistory": () => (/* binding */ getSearchHistory),
-/* harmony export */ "getSetting": () => (/* binding */ getSetting),
-/* harmony export */ "saveSearchHistory": () => (/* binding */ saveSearchHistory),
-/* harmony export */ "saveSettings": () => (/* binding */ saveSettings)
-/* harmony export */ });
-function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
-function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
-var searchName = "instant-images-recent-searches";
-var settingsName = "instant-images-settings";
-var most = 10;
-
-/**
- * Save search value to localstorage.
- *
- * @param {string} term The search term.
- */
-function saveSearchHistory(term) {
- var recent = getSearchHistory();
- if (!recent) {
- localStorage.setItem(searchName, JSON.stringify([term]));
- return;
- }
-
- // Find duplicates.
- var duplicate = recent.indexOf(term);
- if (duplicate > -1) {
- recent.splice(duplicate, 1);
- }
-
- // Limit to 6 items.
- if (recent.length >= most) {
- recent.length = most;
- }
-
- // Add new term to the beginning of the array.
- recent.unshift(term);
- localStorage.setItem(searchName, JSON.stringify(recent));
-}
-
-/**
- * Get the search history from localstorage.
- *
- * @return {Array} The search history.
- */
-function getSearchHistory() {
- var history = localStorage.getItem(searchName);
- if (!history) {
- return [];
- }
- return JSON.parse(localStorage.getItem(searchName));
-}
-
-/**
- * Clear search history.
- */
-function clearSearchHistory() {
- localStorage.removeItem(searchName);
-}
-
-/**
- * Save generic setting to localstorage as an key/value object pair.
- *
- * @param {string} key The object key.
- * @param {value} value The object value.
- */
-function saveSettings(key, value) {
- var settings = localStorage.getItem(settingsName);
- var setting = _defineProperty({}, key, value);
- if (!settings) {
- localStorage.setItem(settingsName, JSON.stringify(setting));
- } else {
- var parsed = JSON.parse(settings);
- parsed[key] = value;
- localStorage.setItem(settingsName, JSON.stringify(parsed));
- }
-}
-
-/**
- * Get an individual setting from local storage.
- *
- * @param {string} key The stoarge key.
- * @return {string|boolean} The storage value.
- */
-function getSetting(key) {
- var settings = localStorage.getItem(settingsName);
- if (!settings) {
- return false;
- }
- var parsed = JSON.parse(settings);
- return parsed[key] ? parsed[key] : false;
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/providers/openverse.js":
-/*!*************************************************!*\
- !*** ./src/js/functions/providers/openverse.js ***!
- \*************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "openverseParams": () => (/* binding */ openverseParams)
-/* harmony export */ });
-/* harmony import */ var _constants_filters_openverse__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../constants/filters/openverse */ "./src/js/constants/filters/openverse.js");
-
-
-/**
- * Format the params for Openverse.
- *
- * @param {string} type Query type (search, photos, id).
- * @param {Object} params Query params object.
- * @return {Object} Updated params.
- */
-function openverseParams(type, params) {
- if (type === "photos" && !params.source) {
- params.source = "wordpress"; // Add `wordpress` as the default openverse `source`.
- }
-
- if (type === "search") {
- // Include these sources only.
- var sources = _constants_filters_openverse__WEBPACK_IMPORTED_MODULE_0__.OPENVERSE_SOURCES.map(function (source) {
- return source.value;
- }).toString(); // e.g. `wordpress,flickr,nasa,spacex,wikimedia`
- params.source = sources;
- }
- return params;
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/providers/unsplash.js":
-/*!************************************************!*\
- !*** ./src/js/functions/providers/unsplash.js ***!
- \************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "unsplashDownload": () => (/* binding */ unsplashDownload)
-/* harmony export */ });
-/* harmony import */ var _buildURL__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../buildURL */ "./src/js/functions/buildURL.js");
-/* harmony import */ var _getQueryParams__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getQueryParams */ "./src/js/functions/getQueryParams.js");
-
-
-
-/**
- * Function to trigger an image download at unsplash.com.
- * Note: This is used to give authors download credits and nothing more.
- *
- * @see https://help.unsplash.com/en/articles/2511258-guideline-triggering-a-download
- *
- * @param {string} download_url The URL to trigger a download.
- * @since 3.1
- */
-function unsplashDownload(download_url) {
- var params = (0,_getQueryParams__WEBPACK_IMPORTED_MODULE_1__.getAuth)({}, "unsplash");
- params.download_url = download_url; // Append download URL to query params.
- var url = (0,_buildURL__WEBPACK_IMPORTED_MODULE_0__["default"])("photos", params);
- fetch(url).then(function (data) {
- return data.json();
- }).then(function () {
- // Success, nothing else happens here
- console.log("Image download successsfully triggered at Unsplash."); // eslint-disable-line no-console
- })["catch"](function (error) {
- console.warn(error);
- });
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/session.js":
-/*!*************************************!*\
- !*** ./src/js/functions/session.js ***!
- \*************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "deleteSession": () => (/* binding */ deleteSession),
-/* harmony export */ "getSession": () => (/* binding */ getSession),
-/* harmony export */ "saveSession": () => (/* binding */ saveSession)
-/* harmony export */ });
-/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/API */ "./src/js/constants/API.js");
-/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/js/functions/helpers.js");
-
-
-
-/**
- * Get results from session storage by URL.
- *
- * @param {string} url The API URL.
- * @return {Array|boolean} Session results.
- */
-function getSession(url) {
- if (!url || _constants_API__WEBPACK_IMPORTED_MODULE_0__.API.testmode) {
- return false; // Exit if no URL or test mode is enabled.
- }
-
- var session = sessionStorage.getItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url));
- if (!session) {
- return false; // Exit if no session data.
- }
-
- var data = JSON.parse(session);
- var _data$expires = data.expires,
- expires = _data$expires === void 0 ? 0 : _data$expires,
- _data$error = data.error,
- error = _data$error === void 0 ? null : _data$error;
- if (error) {
- return false; // Exit if session data has error entry.
- }
-
- // Check if expiration time has passed.
- var expired = Date.now() > expires;
-
- // Delete session data when expired.
- if (expired) {
- deleteSession(url);
- }
- return data && !expired ? data : false;
-}
-
-/**
- * Save API data to session storage by URL.
- *
- * @param {string} url Save results to session by URL.
- * @param {Array} results The API results.
- */
-function saveSession(url, results) {
- if (!url || !results || results !== null && results !== void 0 && results.error) {
- return false;
- }
- // Set expiration to 1 hour.
- results.expires = Date.now() + 3600000;
-
- // Save session data.
- sessionStorage.setItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url), JSON.stringify(results));
-}
-
-/**
- * Remove/delete session storage by URL.
- *
- * @param {string} url The API URL.
- */
-function deleteSession(url) {
- if (!url) {
- return false;
- }
- sessionStorage.removeItem((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.md5Hash)(url));
-}
-
-/***/ }),
-
-/***/ "./src/js/functions/updatePluginSetting.js":
-/*!*************************************************!*\
- !*** ./src/js/functions/updatePluginSetting.js ***!
- \*************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "default": () => (/* binding */ updatePluginSetting)
-/* harmony export */ });
-/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js");
-
-
-/**
- * Update plugin settings by specific key/value pair.
- *
- * @param {string} setting The previous provider.
- * @param {string} value The value to save.
- */
-function updatePluginSetting(setting, value) {
- var _instant_img_localize;
- var api = ((_instant_img_localize = instant_img_localize) === null || _instant_img_localize === void 0 ? void 0 : _instant_img_localize.root) + "instant-images/settings/"; // eslint-disable-line no-undef
-
- var params = {
- setting: setting,
- value: value
- };
- var config = {
- headers: {
- "X-WP-Nonce": instant_img_localize.nonce,
- // eslint-disable-line no-undef
- "Content-Type": "application/json"
- }
- };
- axios__WEBPACK_IMPORTED_MODULE_0__["default"].post(api, JSON.stringify(params), config).then(function () {})["catch"](function (error) {
- console.warn(error);
- });
-}
-
-/***/ }),
-
-/***/ "./src/js/hooks/useArrowControls.js":
-/*!******************************************!*\
- !*** ./src/js/hooks/useArrowControls.js ***!
- \******************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "useArrowControls": () => (/* binding */ useArrowControls)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
-function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
-function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
-
-
-/**
- * Detect up and down arrow presses.
- *
- * @param {boolean} active Is the element currently active.
- * @param {Object} ref The container ref to select the focusable elements.
- */
-function useArrowControls(active, ref) {
- var focusedRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(active);
-
- /**
- * Add event listener for arrow keys.
- *
- * @param {KeyboardEvent} e The event.
- */
- function arrowHandler(e) {
- var key = e.key;
- if (focusedRef !== null && focusedRef !== void 0 && focusedRef.current && ref !== null && ref !== void 0 && ref.current) {
- var focusable = ref === null || ref === void 0 ? void 0 : ref.current.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), input");
- if (!(focusable !== null && focusable !== void 0 && focusable.length)) {
- // Exit if no focusable elements.
- return;
- }
- var first = focusable[0];
- var last = focusable[focusable.length - 1];
- var _active = document.activeElement; // eslint-disable-line
- var activeIndex = _toConsumableArray(focusable).indexOf(_active);
-
- // Up arrow.
- if (key === "ArrowUp") {
- e.preventDefault();
- if (activeIndex === 0) {
- last.focus({
- preventScroll: true
- });
- } else {
- focusable[activeIndex - 1].focus({
- preventScroll: true
- });
- }
- }
- // Down Arrow
- if (key === "ArrowDown") {
- e.preventDefault();
- if (activeIndex === focusable.length - 1 || activeIndex === -1) {
- first.focus({
- preventScroll: true
- });
- } else {
- focusable[activeIndex + 1].focus({
- preventScroll: true
- });
- }
- }
- }
- }
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- focusedRef.current = active;
- }, [active]);
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- document.addEventListener("keydown", arrowHandler, false);
- return function () {
- // Dispose of events.
- document.removeEventListener("keydown", arrowHandler, false);
- };
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
-}
-
-/***/ }),
-
-/***/ "./src/js/hooks/useClickOutside.js":
-/*!*****************************************!*\
- !*** ./src/js/hooks/useClickOutside.js ***!
- \*****************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ "useClickOutside": () => (/* binding */ useClickOutside)
-/* harmony export */ });
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-
-
-/**
- * Detect clicks outside of ref.
- *
- * @param {Object} ref React ref.
- * @param {Function} onClickOutside Function to invoke when clicked outside.
- */
-function useClickOutside(ref, onClickOutside) {
- /**
- * Escape handler.
- *
- * @param {Event} e The key press event.
- */
- function escapeClick(e) {
- var key = e.key;
- if (key === "Escape") {
- onClickOutside();
- }
- }
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
- /**
- * Invoke Function onClick outside of element
- *
- * @param {Event} event The event object.
- */
- function handleClickOutside(event) {
- if (ref.current && !ref.current.contains(event.target)) {
- onClickOutside();
- }
- }
-
- // Bind events.
- document.addEventListener("mousedown", handleClickOutside);
- document.addEventListener("keyup", handleClickOutside);
- document.addEventListener("keydown", escapeClick, false);
- return function () {
- // Dispose of events.
- document.removeEventListener("mousedown", handleClickOutside);
- document.removeEventListener("keyup", handleClickOutside);
- document.removeEventListener("keydown", escapeClick, false);
- };
- }, [ref, onClickOutside]); //eslint-disable-line react-hooks/exhaustive-deps
-}
-
-/***/ }),
-
-/***/ "./src/js/index.js":
-/*!*************************!*\
- !*** ./src/js/index.js ***!
- \*************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-"use strict";
-__webpack_require__.r(__webpack_exports__);
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element");
-/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _components_InstantImages__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/InstantImages */ "./src/js/components/InstantImages.js");
-/* harmony import */ var _constants_API__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants/API */ "./src/js/constants/API.js");
-/* harmony import */ var _functions_buildURL__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./functions/buildURL */ "./src/js/functions/buildURL.js");
-/* harmony import */ var _functions_consoleStatus__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./functions/consoleStatus */ "./src/js/functions/consoleStatus.js");
-/* harmony import */ var _functions_getProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./functions/getProvider */ "./src/js/functions/getProvider.js");
-/* harmony import */ var _functions_getQueryParams__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions/getQueryParams */ "./src/js/functions/getQueryParams.js");
-/* harmony import */ var _functions_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./functions/helpers */ "./src/js/functions/helpers.js");
-/* harmony import */ var _functions_session__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./functions/session */ "./src/js/functions/session.js");
-/* harmony import */ var _scss_style_scss__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../scss/style.scss */ "./src/scss/style.scss");
-function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
-function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
-function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
-function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
-
-
-
-
-
-
-
-
-
-
-
-// Get provider from settings.
-var defaultProvider = (0,_functions_getProvider__WEBPACK_IMPORTED_MODULE_5__["default"])();
-
-/**
- * Get the initial set of photos.
- *
- * @param {string} provider The current service provider.
- */
-function getImages() {
- var provider = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _constants_API__WEBPACK_IMPORTED_MODULE_2__.API.defaults.provider;
- // Build URL.
- var params = (0,_functions_getQueryParams__WEBPACK_IMPORTED_MODULE_6__["default"])(provider);
- var url = (0,_functions_buildURL__WEBPACK_IMPORTED_MODULE_3__["default"])("photos", params);
- function initialize() {
- return _initialize.apply(this, arguments);
- }
- function _initialize() {
- _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
- var app, sessionData, root, response, status, headers, results, _results$error, error, _root;
- return _regeneratorRuntime().wrap(function _callee$(_context) {
- while (1) switch (_context.prev = _context.next) {
- case 0:
- app = document.getElementById("app");
- if (!app) {
- _context.next = 25;
- break;
- }
- // Get session storage.
- sessionData = (0,_functions_session__WEBPACK_IMPORTED_MODULE_8__.getSession)(url);
- if (!sessionData) {
- _context.next = 7;
- break;
- }
- // Display results from session.
- if (_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRoot) {
- root = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRoot)(app);
- root.render( /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_1__["default"], {
- editor: "classic",
- data: sessionData,
- container: app,
- provider: provider,
- api_error: null
- }));
- } else {
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.render)( /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_1__["default"], {
- editor: "classic",
- data: sessionData,
- container: app,
- provider: provider,
- api_error: null
- }), app);
- }
- _context.next = 25;
- break;
- case 7:
- _context.next = 9;
- return fetch(url);
- case 9:
- response = _context.sent;
- status = response.status, headers = response.headers;
- (0,_functions_helpers__WEBPACK_IMPORTED_MODULE_7__.checkRateLimit)(headers);
- _context.prev = 12;
- _context.next = 15;
- return response.json();
- case 15:
- results = _context.sent;
- _results$error = results.error, error = _results$error === void 0 ? null : _results$error;
- if (_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRoot) {
- _root = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createRoot)(app);
- _root.render( /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_1__["default"], {
- editor: "classic",
- data: results,
- container: app,
- provider: provider,
- api_error: error
- }));
- } else {
- (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.render)( /*#__PURE__*/React.createElement(_components_InstantImages__WEBPACK_IMPORTED_MODULE_1__["default"], {
- editor: "classic",
- data: results,
- container: app,
- provider: provider,
- api_error: error
- }), app);
- }
- (0,_functions_session__WEBPACK_IMPORTED_MODULE_8__.saveSession)(url, results);
- _context.next = 25;
- break;
- case 21:
- _context.prev = 21;
- _context.t0 = _context["catch"](12);
- (0,_functions_consoleStatus__WEBPACK_IMPORTED_MODULE_4__["default"])(provider, status);
- (0,_functions_session__WEBPACK_IMPORTED_MODULE_8__.deleteSession)(url);
- case 25:
- case "end":
- return _context.stop();
- }
- }, _callee, null, [[12, 21]]);
- }));
- return _initialize.apply(this, arguments);
- }
- initialize();
-}
-
-/**
- * Dispatch an initial fetch request to confirm the default API key is valid.
- */
-_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
- while (1) switch (_context2.prev = _context2.next) {
- case 0:
- getImages(defaultProvider);
- case 1:
- case "end":
- return _context2.stop();
- }
- }, _callee2);
-}))();
-
-/***/ }),
-
-/***/ "./node_modules/classnames/index.js":
-/*!******************************************!*\
- !*** ./node_modules/classnames/index.js ***!
- \******************************************/
-/***/ ((module, exports) => {
-
-var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- Copyright (c) 2018 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
-*/
-/* global define */
-
-(function () {
- 'use strict';
-
- var hasOwn = {}.hasOwnProperty;
- var nativeCodeString = '[native code]';
-
- function classNames() {
- var classes = [];
-
- for (var i = 0; i < arguments.length; i++) {
- var arg = arguments[i];
- if (!arg) continue;
-
- var argType = typeof arg;
-
- if (argType === 'string' || argType === 'number') {
- classes.push(arg);
- } else if (Array.isArray(arg)) {
- if (arg.length) {
- var inner = classNames.apply(null, arg);
- if (inner) {
- classes.push(inner);
- }
- }
- } else if (argType === 'object') {
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
- classes.push(arg.toString());
- continue;
- }
-
- for (var key in arg) {
- if (hasOwn.call(arg, key) && arg[key]) {
- classes.push(key);
- }
- }
- }
- }
-
- return classes.join(' ');
- }
-
- if ( true && module.exports) {
- classNames.default = classNames;
- module.exports = classNames;
- } else if (true) {
- // register as 'classnames', consistent with npm package name
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
- return classNames;
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
-}());
-
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/aes.js":
-/*!***************************************!*\
- !*** ./node_modules/crypto-js/aes.js ***!
- \***************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var BlockCipher = C_lib.BlockCipher;
- var C_algo = C.algo;
-
- // Lookup tables
- var SBOX = [];
- var INV_SBOX = [];
- var SUB_MIX_0 = [];
- var SUB_MIX_1 = [];
- var SUB_MIX_2 = [];
- var SUB_MIX_3 = [];
- var INV_SUB_MIX_0 = [];
- var INV_SUB_MIX_1 = [];
- var INV_SUB_MIX_2 = [];
- var INV_SUB_MIX_3 = [];
-
- // Compute lookup tables
- (function () {
- // Compute double table
- var d = [];
- for (var i = 0; i < 256; i++) {
- if (i < 128) {
- d[i] = i << 1;
- } else {
- d[i] = (i << 1) ^ 0x11b;
- }
- }
-
- // Walk GF(2^8)
- var x = 0;
- var xi = 0;
- for (var i = 0; i < 256; i++) {
- // Compute sbox
- var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
- sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
- SBOX[x] = sx;
- INV_SBOX[sx] = x;
-
- // Compute multiplication
- var x2 = d[x];
- var x4 = d[x2];
- var x8 = d[x4];
-
- // Compute sub bytes, mix columns tables
- var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
- SUB_MIX_0[x] = (t << 24) | (t >>> 8);
- SUB_MIX_1[x] = (t << 16) | (t >>> 16);
- SUB_MIX_2[x] = (t << 8) | (t >>> 24);
- SUB_MIX_3[x] = t;
-
- // Compute inv sub bytes, inv mix columns tables
- var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
- INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
- INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
- INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);
- INV_SUB_MIX_3[sx] = t;
-
- // Compute next counter
- if (!x) {
- x = xi = 1;
- } else {
- x = x2 ^ d[d[d[x8 ^ x2]]];
- xi ^= d[d[xi]];
- }
- }
- }());
-
- // Precomputed Rcon lookup
- var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
-
- /**
- * AES block cipher algorithm.
- */
- var AES = C_algo.AES = BlockCipher.extend({
- _doReset: function () {
- var t;
-
- // Skip reset of nRounds has been set before and key did not change
- if (this._nRounds && this._keyPriorReset === this._key) {
- return;
- }
-
- // Shortcuts
- var key = this._keyPriorReset = this._key;
- var keyWords = key.words;
- var keySize = key.sigBytes / 4;
-
- // Compute number of rounds
- var nRounds = this._nRounds = keySize + 6;
-
- // Compute number of key schedule rows
- var ksRows = (nRounds + 1) * 4;
-
- // Compute key schedule
- var keySchedule = this._keySchedule = [];
- for (var ksRow = 0; ksRow < ksRows; ksRow++) {
- if (ksRow < keySize) {
- keySchedule[ksRow] = keyWords[ksRow];
- } else {
- t = keySchedule[ksRow - 1];
-
- if (!(ksRow % keySize)) {
- // Rot word
- t = (t << 8) | (t >>> 24);
-
- // Sub word
- t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
-
- // Mix Rcon
- t ^= RCON[(ksRow / keySize) | 0] << 24;
- } else if (keySize > 6 && ksRow % keySize == 4) {
- // Sub word
- t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
- }
-
- keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
- }
- }
-
- // Compute inv key schedule
- var invKeySchedule = this._invKeySchedule = [];
- for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
- var ksRow = ksRows - invKsRow;
-
- if (invKsRow % 4) {
- var t = keySchedule[ksRow];
- } else {
- var t = keySchedule[ksRow - 4];
- }
-
- if (invKsRow < 4 || ksRow <= 4) {
- invKeySchedule[invKsRow] = t;
- } else {
- invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^
- INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
- }
- }
- },
-
- encryptBlock: function (M, offset) {
- this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
- },
-
- decryptBlock: function (M, offset) {
- // Swap 2nd and 4th rows
- var t = M[offset + 1];
- M[offset + 1] = M[offset + 3];
- M[offset + 3] = t;
-
- this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
-
- // Inv swap 2nd and 4th rows
- var t = M[offset + 1];
- M[offset + 1] = M[offset + 3];
- M[offset + 3] = t;
- },
-
- _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
- // Shortcut
- var nRounds = this._nRounds;
-
- // Get input, add round key
- var s0 = M[offset] ^ keySchedule[0];
- var s1 = M[offset + 1] ^ keySchedule[1];
- var s2 = M[offset + 2] ^ keySchedule[2];
- var s3 = M[offset + 3] ^ keySchedule[3];
-
- // Key schedule row counter
- var ksRow = 4;
-
- // Rounds
- for (var round = 1; round < nRounds; round++) {
- // Shift rows, sub bytes, mix columns, add round key
- var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];
- var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];
- var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];
- var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];
-
- // Update state
- s0 = t0;
- s1 = t1;
- s2 = t2;
- s3 = t3;
- }
-
- // Shift rows, sub bytes, add round key
- var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
- var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
- var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
- var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
-
- // Set output
- M[offset] = t0;
- M[offset + 1] = t1;
- M[offset + 2] = t2;
- M[offset + 3] = t3;
- },
-
- keySize: 256/32
- });
-
- /**
- * Shortcut functions to the cipher's object interface.
- *
- * @example
- *
- * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
- * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);
- */
- C.AES = BlockCipher._createHelper(AES);
- }());
-
-
- return CryptoJS.AES;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/cipher-core.js":
-/*!***********************************************!*\
- !*** ./node_modules/crypto-js/cipher-core.js ***!
- \***********************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /**
- * Cipher core components.
- */
- CryptoJS.lib.Cipher || (function (undefined) {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var Base = C_lib.Base;
- var WordArray = C_lib.WordArray;
- var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
- var C_enc = C.enc;
- var Utf8 = C_enc.Utf8;
- var Base64 = C_enc.Base64;
- var C_algo = C.algo;
- var EvpKDF = C_algo.EvpKDF;
-
- /**
- * Abstract base cipher template.
- *
- * @property {number} keySize This cipher's key size. Default: 4 (128 bits)
- * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
- * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
- * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
- */
- var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
- /**
- * Configuration options.
- *
- * @property {WordArray} iv The IV to use for this operation.
- */
- cfg: Base.extend(),
-
- /**
- * Creates this cipher in encryption mode.
- *
- * @param {WordArray} key The key.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {Cipher} A cipher instance.
- *
- * @static
- *
- * @example
- *
- * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
- */
- createEncryptor: function (key, cfg) {
- return this.create(this._ENC_XFORM_MODE, key, cfg);
- },
-
- /**
- * Creates this cipher in decryption mode.
- *
- * @param {WordArray} key The key.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {Cipher} A cipher instance.
- *
- * @static
- *
- * @example
- *
- * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
- */
- createDecryptor: function (key, cfg) {
- return this.create(this._DEC_XFORM_MODE, key, cfg);
- },
-
- /**
- * Initializes a newly created cipher.
- *
- * @param {number} xformMode Either the encryption or decryption transormation mode constant.
- * @param {WordArray} key The key.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @example
- *
- * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
- */
- init: function (xformMode, key, cfg) {
- // Apply config defaults
- this.cfg = this.cfg.extend(cfg);
-
- // Store transform mode and key
- this._xformMode = xformMode;
- this._key = key;
-
- // Set initial values
- this.reset();
- },
-
- /**
- * Resets this cipher to its initial state.
- *
- * @example
- *
- * cipher.reset();
- */
- reset: function () {
- // Reset data buffer
- BufferedBlockAlgorithm.reset.call(this);
-
- // Perform concrete-cipher logic
- this._doReset();
- },
-
- /**
- * Adds data to be encrypted or decrypted.
- *
- * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
- *
- * @return {WordArray} The data after processing.
- *
- * @example
- *
- * var encrypted = cipher.process('data');
- * var encrypted = cipher.process(wordArray);
- */
- process: function (dataUpdate) {
- // Append
- this._append(dataUpdate);
-
- // Process available blocks
- return this._process();
- },
-
- /**
- * Finalizes the encryption or decryption process.
- * Note that the finalize operation is effectively a destructive, read-once operation.
- *
- * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
- *
- * @return {WordArray} The data after final processing.
- *
- * @example
- *
- * var encrypted = cipher.finalize();
- * var encrypted = cipher.finalize('data');
- * var encrypted = cipher.finalize(wordArray);
- */
- finalize: function (dataUpdate) {
- // Final data update
- if (dataUpdate) {
- this._append(dataUpdate);
- }
-
- // Perform concrete-cipher logic
- var finalProcessedData = this._doFinalize();
-
- return finalProcessedData;
- },
-
- keySize: 128/32,
-
- ivSize: 128/32,
-
- _ENC_XFORM_MODE: 1,
-
- _DEC_XFORM_MODE: 2,
-
- /**
- * Creates shortcut functions to a cipher's object interface.
- *
- * @param {Cipher} cipher The cipher to create a helper for.
- *
- * @return {Object} An object with encrypt and decrypt shortcut functions.
- *
- * @static
- *
- * @example
- *
- * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
- */
- _createHelper: (function () {
- function selectCipherStrategy(key) {
- if (typeof key == 'string') {
- return PasswordBasedCipher;
- } else {
- return SerializableCipher;
- }
- }
-
- return function (cipher) {
- return {
- encrypt: function (message, key, cfg) {
- return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
- },
-
- decrypt: function (ciphertext, key, cfg) {
- return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
- }
- };
- };
- }())
- });
-
- /**
- * Abstract base stream cipher template.
- *
- * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
- */
- var StreamCipher = C_lib.StreamCipher = Cipher.extend({
- _doFinalize: function () {
- // Process partial blocks
- var finalProcessedBlocks = this._process(!!'flush');
-
- return finalProcessedBlocks;
- },
-
- blockSize: 1
- });
-
- /**
- * Mode namespace.
- */
- var C_mode = C.mode = {};
-
- /**
- * Abstract base block cipher mode template.
- */
- var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
- /**
- * Creates this mode for encryption.
- *
- * @param {Cipher} cipher A block cipher instance.
- * @param {Array} iv The IV words.
- *
- * @static
- *
- * @example
- *
- * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
- */
- createEncryptor: function (cipher, iv) {
- return this.Encryptor.create(cipher, iv);
- },
-
- /**
- * Creates this mode for decryption.
- *
- * @param {Cipher} cipher A block cipher instance.
- * @param {Array} iv The IV words.
- *
- * @static
- *
- * @example
- *
- * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
- */
- createDecryptor: function (cipher, iv) {
- return this.Decryptor.create(cipher, iv);
- },
-
- /**
- * Initializes a newly created mode.
- *
- * @param {Cipher} cipher A block cipher instance.
- * @param {Array} iv The IV words.
- *
- * @example
- *
- * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
- */
- init: function (cipher, iv) {
- this._cipher = cipher;
- this._iv = iv;
- }
- });
-
- /**
- * Cipher Block Chaining mode.
- */
- var CBC = C_mode.CBC = (function () {
- /**
- * Abstract base CBC mode.
- */
- var CBC = BlockCipherMode.extend();
-
- /**
- * CBC encryptor.
- */
- CBC.Encryptor = CBC.extend({
- /**
- * Processes the data block at offset.
- *
- * @param {Array} words The data words to operate on.
- * @param {number} offset The offset where the block starts.
- *
- * @example
- *
- * mode.processBlock(data.words, offset);
- */
- processBlock: function (words, offset) {
- // Shortcuts
- var cipher = this._cipher;
- var blockSize = cipher.blockSize;
-
- // XOR and encrypt
- xorBlock.call(this, words, offset, blockSize);
- cipher.encryptBlock(words, offset);
-
- // Remember this block to use with next block
- this._prevBlock = words.slice(offset, offset + blockSize);
- }
- });
-
- /**
- * CBC decryptor.
- */
- CBC.Decryptor = CBC.extend({
- /**
- * Processes the data block at offset.
- *
- * @param {Array} words The data words to operate on.
- * @param {number} offset The offset where the block starts.
- *
- * @example
- *
- * mode.processBlock(data.words, offset);
- */
- processBlock: function (words, offset) {
- // Shortcuts
- var cipher = this._cipher;
- var blockSize = cipher.blockSize;
-
- // Remember this block to use with next block
- var thisBlock = words.slice(offset, offset + blockSize);
-
- // Decrypt and XOR
- cipher.decryptBlock(words, offset);
- xorBlock.call(this, words, offset, blockSize);
-
- // This block becomes the previous block
- this._prevBlock = thisBlock;
- }
- });
-
- function xorBlock(words, offset, blockSize) {
- var block;
-
- // Shortcut
- var iv = this._iv;
-
- // Choose mixing block
- if (iv) {
- block = iv;
-
- // Remove IV for subsequent blocks
- this._iv = undefined;
- } else {
- block = this._prevBlock;
- }
-
- // XOR blocks
- for (var i = 0; i < blockSize; i++) {
- words[offset + i] ^= block[i];
- }
- }
-
- return CBC;
- }());
-
- /**
- * Padding namespace.
- */
- var C_pad = C.pad = {};
-
- /**
- * PKCS #5/7 padding strategy.
- */
- var Pkcs7 = C_pad.Pkcs7 = {
- /**
- * Pads data using the algorithm defined in PKCS #5/7.
- *
- * @param {WordArray} data The data to pad.
- * @param {number} blockSize The multiple that the data should be padded to.
- *
- * @static
- *
- * @example
- *
- * CryptoJS.pad.Pkcs7.pad(wordArray, 4);
- */
- pad: function (data, blockSize) {
- // Shortcut
- var blockSizeBytes = blockSize * 4;
-
- // Count padding bytes
- var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
-
- // Create padding word
- var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
-
- // Create padding
- var paddingWords = [];
- for (var i = 0; i < nPaddingBytes; i += 4) {
- paddingWords.push(paddingWord);
- }
- var padding = WordArray.create(paddingWords, nPaddingBytes);
-
- // Add padding
- data.concat(padding);
- },
-
- /**
- * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
- *
- * @param {WordArray} data The data to unpad.
- *
- * @static
- *
- * @example
- *
- * CryptoJS.pad.Pkcs7.unpad(wordArray);
- */
- unpad: function (data) {
- // Get number of padding bytes from last byte
- var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
-
- // Remove padding
- data.sigBytes -= nPaddingBytes;
- }
- };
-
- /**
- * Abstract base block cipher template.
- *
- * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
- */
- var BlockCipher = C_lib.BlockCipher = Cipher.extend({
- /**
- * Configuration options.
- *
- * @property {Mode} mode The block mode to use. Default: CBC
- * @property {Padding} padding The padding strategy to use. Default: Pkcs7
- */
- cfg: Cipher.cfg.extend({
- mode: CBC,
- padding: Pkcs7
- }),
-
- reset: function () {
- var modeCreator;
-
- // Reset cipher
- Cipher.reset.call(this);
-
- // Shortcuts
- var cfg = this.cfg;
- var iv = cfg.iv;
- var mode = cfg.mode;
-
- // Reset block mode
- if (this._xformMode == this._ENC_XFORM_MODE) {
- modeCreator = mode.createEncryptor;
- } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
- modeCreator = mode.createDecryptor;
- // Keep at least one block in the buffer for unpadding
- this._minBufferSize = 1;
- }
-
- if (this._mode && this._mode.__creator == modeCreator) {
- this._mode.init(this, iv && iv.words);
- } else {
- this._mode = modeCreator.call(mode, this, iv && iv.words);
- this._mode.__creator = modeCreator;
- }
- },
-
- _doProcessBlock: function (words, offset) {
- this._mode.processBlock(words, offset);
- },
-
- _doFinalize: function () {
- var finalProcessedBlocks;
-
- // Shortcut
- var padding = this.cfg.padding;
-
- // Finalize
- if (this._xformMode == this._ENC_XFORM_MODE) {
- // Pad data
- padding.pad(this._data, this.blockSize);
-
- // Process final blocks
- finalProcessedBlocks = this._process(!!'flush');
- } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
- // Process final blocks
- finalProcessedBlocks = this._process(!!'flush');
-
- // Unpad data
- padding.unpad(finalProcessedBlocks);
- }
-
- return finalProcessedBlocks;
- },
-
- blockSize: 128/32
- });
-
- /**
- * A collection of cipher parameters.
- *
- * @property {WordArray} ciphertext The raw ciphertext.
- * @property {WordArray} key The key to this ciphertext.
- * @property {WordArray} iv The IV used in the ciphering operation.
- * @property {WordArray} salt The salt used with a key derivation function.
- * @property {Cipher} algorithm The cipher algorithm.
- * @property {Mode} mode The block mode used in the ciphering operation.
- * @property {Padding} padding The padding scheme used in the ciphering operation.
- * @property {number} blockSize The block size of the cipher.
- * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
- */
- var CipherParams = C_lib.CipherParams = Base.extend({
- /**
- * Initializes a newly created cipher params object.
- *
- * @param {Object} cipherParams An object with any of the possible cipher parameters.
- *
- * @example
- *
- * var cipherParams = CryptoJS.lib.CipherParams.create({
- * ciphertext: ciphertextWordArray,
- * key: keyWordArray,
- * iv: ivWordArray,
- * salt: saltWordArray,
- * algorithm: CryptoJS.algo.AES,
- * mode: CryptoJS.mode.CBC,
- * padding: CryptoJS.pad.PKCS7,
- * blockSize: 4,
- * formatter: CryptoJS.format.OpenSSL
- * });
- */
- init: function (cipherParams) {
- this.mixIn(cipherParams);
- },
-
- /**
- * Converts this cipher params object to a string.
- *
- * @param {Format} formatter (Optional) The formatting strategy to use.
- *
- * @return {string} The stringified cipher params.
- *
- * @throws Error If neither the formatter nor the default formatter is set.
- *
- * @example
- *
- * var string = cipherParams + '';
- * var string = cipherParams.toString();
- * var string = cipherParams.toString(CryptoJS.format.OpenSSL);
- */
- toString: function (formatter) {
- return (formatter || this.formatter).stringify(this);
- }
- });
-
- /**
- * Format namespace.
- */
- var C_format = C.format = {};
-
- /**
- * OpenSSL formatting strategy.
- */
- var OpenSSLFormatter = C_format.OpenSSL = {
- /**
- * Converts a cipher params object to an OpenSSL-compatible string.
- *
- * @param {CipherParams} cipherParams The cipher params object.
- *
- * @return {string} The OpenSSL-compatible string.
- *
- * @static
- *
- * @example
- *
- * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
- */
- stringify: function (cipherParams) {
- var wordArray;
-
- // Shortcuts
- var ciphertext = cipherParams.ciphertext;
- var salt = cipherParams.salt;
-
- // Format
- if (salt) {
- wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
- } else {
- wordArray = ciphertext;
- }
-
- return wordArray.toString(Base64);
- },
-
- /**
- * Converts an OpenSSL-compatible string to a cipher params object.
- *
- * @param {string} openSSLStr The OpenSSL-compatible string.
- *
- * @return {CipherParams} The cipher params object.
- *
- * @static
- *
- * @example
- *
- * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
- */
- parse: function (openSSLStr) {
- var salt;
-
- // Parse base64
- var ciphertext = Base64.parse(openSSLStr);
-
- // Shortcut
- var ciphertextWords = ciphertext.words;
-
- // Test for salt
- if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
- // Extract salt
- salt = WordArray.create(ciphertextWords.slice(2, 4));
-
- // Remove salt from ciphertext
- ciphertextWords.splice(0, 4);
- ciphertext.sigBytes -= 16;
- }
-
- return CipherParams.create({ ciphertext: ciphertext, salt: salt });
- }
- };
-
- /**
- * A cipher wrapper that returns ciphertext as a serializable cipher params object.
- */
- var SerializableCipher = C_lib.SerializableCipher = Base.extend({
- /**
- * Configuration options.
- *
- * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
- */
- cfg: Base.extend({
- format: OpenSSLFormatter
- }),
-
- /**
- * Encrypts a message.
- *
- * @param {Cipher} cipher The cipher algorithm to use.
- * @param {WordArray|string} message The message to encrypt.
- * @param {WordArray} key The key.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {CipherParams} A cipher params object.
- *
- * @static
- *
- * @example
- *
- * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
- * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
- * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
- */
- encrypt: function (cipher, message, key, cfg) {
- // Apply config defaults
- cfg = this.cfg.extend(cfg);
-
- // Encrypt
- var encryptor = cipher.createEncryptor(key, cfg);
- var ciphertext = encryptor.finalize(message);
-
- // Shortcut
- var cipherCfg = encryptor.cfg;
-
- // Create and return serializable cipher params
- return CipherParams.create({
- ciphertext: ciphertext,
- key: key,
- iv: cipherCfg.iv,
- algorithm: cipher,
- mode: cipherCfg.mode,
- padding: cipherCfg.padding,
- blockSize: cipher.blockSize,
- formatter: cfg.format
- });
- },
-
- /**
- * Decrypts serialized ciphertext.
- *
- * @param {Cipher} cipher The cipher algorithm to use.
- * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
- * @param {WordArray} key The key.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {WordArray} The plaintext.
- *
- * @static
- *
- * @example
- *
- * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
- * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
- */
- decrypt: function (cipher, ciphertext, key, cfg) {
- // Apply config defaults
- cfg = this.cfg.extend(cfg);
-
- // Convert string to CipherParams
- ciphertext = this._parse(ciphertext, cfg.format);
-
- // Decrypt
- var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
-
- return plaintext;
- },
-
- /**
- * Converts serialized ciphertext to CipherParams,
- * else assumed CipherParams already and returns ciphertext unchanged.
- *
- * @param {CipherParams|string} ciphertext The ciphertext.
- * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
- *
- * @return {CipherParams} The unserialized ciphertext.
- *
- * @static
- *
- * @example
- *
- * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
- */
- _parse: function (ciphertext, format) {
- if (typeof ciphertext == 'string') {
- return format.parse(ciphertext, this);
- } else {
- return ciphertext;
- }
- }
- });
-
- /**
- * Key derivation function namespace.
- */
- var C_kdf = C.kdf = {};
-
- /**
- * OpenSSL key derivation function.
- */
- var OpenSSLKdf = C_kdf.OpenSSL = {
- /**
- * Derives a key and IV from a password.
- *
- * @param {string} password The password to derive from.
- * @param {number} keySize The size in words of the key to generate.
- * @param {number} ivSize The size in words of the IV to generate.
- * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
- *
- * @return {CipherParams} A cipher params object with the key, IV, and salt.
- *
- * @static
- *
- * @example
- *
- * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
- * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
- */
- execute: function (password, keySize, ivSize, salt) {
- // Generate random salt
- if (!salt) {
- salt = WordArray.random(64/8);
- }
-
- // Derive key and IV
- var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
-
- // Separate key and IV
- var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
- key.sigBytes = keySize * 4;
-
- // Return params
- return CipherParams.create({ key: key, iv: iv, salt: salt });
- }
- };
-
- /**
- * A serializable cipher wrapper that derives the key from a password,
- * and returns ciphertext as a serializable cipher params object.
- */
- var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
- /**
- * Configuration options.
- *
- * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
- */
- cfg: SerializableCipher.cfg.extend({
- kdf: OpenSSLKdf
- }),
-
- /**
- * Encrypts a message using a password.
- *
- * @param {Cipher} cipher The cipher algorithm to use.
- * @param {WordArray|string} message The message to encrypt.
- * @param {string} password The password.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {CipherParams} A cipher params object.
- *
- * @static
- *
- * @example
- *
- * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
- * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
- */
- encrypt: function (cipher, message, password, cfg) {
- // Apply config defaults
- cfg = this.cfg.extend(cfg);
-
- // Derive key and other params
- var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
-
- // Add IV to config
- cfg.iv = derivedParams.iv;
-
- // Encrypt
- var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
-
- // Mix in derived params
- ciphertext.mixIn(derivedParams);
-
- return ciphertext;
- },
-
- /**
- * Decrypts serialized ciphertext using a password.
- *
- * @param {Cipher} cipher The cipher algorithm to use.
- * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
- * @param {string} password The password.
- * @param {Object} cfg (Optional) The configuration options to use for this operation.
- *
- * @return {WordArray} The plaintext.
- *
- * @static
- *
- * @example
- *
- * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
- * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
- */
- decrypt: function (cipher, ciphertext, password, cfg) {
- // Apply config defaults
- cfg = this.cfg.extend(cfg);
-
- // Convert string to CipherParams
- ciphertext = this._parse(ciphertext, cfg.format);
-
- // Derive key and other params
- var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
-
- // Add IV to config
- cfg.iv = derivedParams.iv;
-
- // Decrypt
- var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
-
- return plaintext;
- }
- });
- }());
-
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/core.js":
-/*!****************************************!*\
- !*** ./node_modules/crypto-js/core.js ***!
- \****************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory) {
- if (true) {
- // CommonJS
- module.exports = exports = factory();
- }
- else {}
-}(this, function () {
-
- /*globals window, global, require*/
-
- /**
- * CryptoJS core components.
- */
- var CryptoJS = CryptoJS || (function (Math, undefined) {
-
- var crypto;
-
- // Native crypto from window (Browser)
- if (typeof window !== 'undefined' && window.crypto) {
- crypto = window.crypto;
- }
-
- // Native crypto in web worker (Browser)
- if (typeof self !== 'undefined' && self.crypto) {
- crypto = self.crypto;
- }
-
- // Native crypto from worker
- if (typeof globalThis !== 'undefined' && globalThis.crypto) {
- crypto = globalThis.crypto;
- }
-
- // Native (experimental IE 11) crypto from window (Browser)
- if (!crypto && typeof window !== 'undefined' && window.msCrypto) {
- crypto = window.msCrypto;
- }
-
- // Native crypto from global (NodeJS)
- if (!crypto && typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.crypto) {
- crypto = __webpack_require__.g.crypto;
- }
-
- // Native crypto import via require (NodeJS)
- if (!crypto && "function" === 'function') {
- try {
- crypto = __webpack_require__(/*! crypto */ "?9157");
- } catch (err) {}
- }
-
- /*
- * Cryptographically secure pseudorandom number generator
- *
- * As Math.random() is cryptographically not safe to use
- */
- var cryptoSecureRandomInt = function () {
- if (crypto) {
- // Use getRandomValues method (Browser)
- if (typeof crypto.getRandomValues === 'function') {
- try {
- return crypto.getRandomValues(new Uint32Array(1))[0];
- } catch (err) {}
- }
-
- // Use randomBytes method (NodeJS)
- if (typeof crypto.randomBytes === 'function') {
- try {
- return crypto.randomBytes(4).readInt32LE();
- } catch (err) {}
- }
- }
-
- throw new Error('Native crypto module could not be used to get secure random number.');
- };
-
- /*
- * Local polyfill of Object.create
-
- */
- var create = Object.create || (function () {
- function F() {}
-
- return function (obj) {
- var subtype;
-
- F.prototype = obj;
-
- subtype = new F();
-
- F.prototype = null;
-
- return subtype;
- };
- }());
-
- /**
- * CryptoJS namespace.
- */
- var C = {};
-
- /**
- * Library namespace.
- */
- var C_lib = C.lib = {};
-
- /**
- * Base object for prototypal inheritance.
- */
- var Base = C_lib.Base = (function () {
-
-
- return {
- /**
- * Creates a new object that inherits from this object.
- *
- * @param {Object} overrides Properties to copy into the new object.
- *
- * @return {Object} The new object.
- *
- * @static
- *
- * @example
- *
- * var MyType = CryptoJS.lib.Base.extend({
- * field: 'value',
- *
- * method: function () {
- * }
- * });
- */
- extend: function (overrides) {
- // Spawn
- var subtype = create(this);
-
- // Augment
- if (overrides) {
- subtype.mixIn(overrides);
- }
-
- // Create default initializer
- if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
- subtype.init = function () {
- subtype.$super.init.apply(this, arguments);
- };
- }
-
- // Initializer's prototype is the subtype object
- subtype.init.prototype = subtype;
-
- // Reference supertype
- subtype.$super = this;
-
- return subtype;
- },
-
- /**
- * Extends this object and runs the init method.
- * Arguments to create() will be passed to init().
- *
- * @return {Object} The new object.
- *
- * @static
- *
- * @example
- *
- * var instance = MyType.create();
- */
- create: function () {
- var instance = this.extend();
- instance.init.apply(instance, arguments);
-
- return instance;
- },
-
- /**
- * Initializes a newly created object.
- * Override this method to add some logic when your objects are created.
- *
- * @example
- *
- * var MyType = CryptoJS.lib.Base.extend({
- * init: function () {
- * // ...
- * }
- * });
- */
- init: function () {
- },
-
- /**
- * Copies properties into this object.
- *
- * @param {Object} properties The properties to mix in.
- *
- * @example
- *
- * MyType.mixIn({
- * field: 'value'
- * });
- */
- mixIn: function (properties) {
- for (var propertyName in properties) {
- if (properties.hasOwnProperty(propertyName)) {
- this[propertyName] = properties[propertyName];
- }
- }
-
- // IE won't copy toString using the loop above
- if (properties.hasOwnProperty('toString')) {
- this.toString = properties.toString;
- }
- },
-
- /**
- * Creates a copy of this object.
- *
- * @return {Object} The clone.
- *
- * @example
- *
- * var clone = instance.clone();
- */
- clone: function () {
- return this.init.prototype.extend(this);
- }
- };
- }());
-
- /**
- * An array of 32-bit words.
- *
- * @property {Array} words The array of 32-bit words.
- * @property {number} sigBytes The number of significant bytes in this word array.
- */
- var WordArray = C_lib.WordArray = Base.extend({
- /**
- * Initializes a newly created word array.
- *
- * @param {Array} words (Optional) An array of 32-bit words.
- * @param {number} sigBytes (Optional) The number of significant bytes in the words.
- *
- * @example
- *
- * var wordArray = CryptoJS.lib.WordArray.create();
- * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
- * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
- */
- init: function (words, sigBytes) {
- words = this.words = words || [];
-
- if (sigBytes != undefined) {
- this.sigBytes = sigBytes;
- } else {
- this.sigBytes = words.length * 4;
- }
- },
-
- /**
- * Converts this word array to a string.
- *
- * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
- *
- * @return {string} The stringified word array.
- *
- * @example
- *
- * var string = wordArray + '';
- * var string = wordArray.toString();
- * var string = wordArray.toString(CryptoJS.enc.Utf8);
- */
- toString: function (encoder) {
- return (encoder || Hex).stringify(this);
- },
-
- /**
- * Concatenates a word array to this word array.
- *
- * @param {WordArray} wordArray The word array to append.
- *
- * @return {WordArray} This word array.
- *
- * @example
- *
- * wordArray1.concat(wordArray2);
- */
- concat: function (wordArray) {
- // Shortcuts
- var thisWords = this.words;
- var thatWords = wordArray.words;
- var thisSigBytes = this.sigBytes;
- var thatSigBytes = wordArray.sigBytes;
-
- // Clamp excess bits
- this.clamp();
-
- // Concat
- if (thisSigBytes % 4) {
- // Copy one byte at a time
- for (var i = 0; i < thatSigBytes; i++) {
- var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
- thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
- }
- } else {
- // Copy one word at a time
- for (var j = 0; j < thatSigBytes; j += 4) {
- thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];
- }
- }
- this.sigBytes += thatSigBytes;
-
- // Chainable
- return this;
- },
-
- /**
- * Removes insignificant bits.
- *
- * @example
- *
- * wordArray.clamp();
- */
- clamp: function () {
- // Shortcuts
- var words = this.words;
- var sigBytes = this.sigBytes;
-
- // Clamp
- words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
- words.length = Math.ceil(sigBytes / 4);
- },
-
- /**
- * Creates a copy of this word array.
- *
- * @return {WordArray} The clone.
- *
- * @example
- *
- * var clone = wordArray.clone();
- */
- clone: function () {
- var clone = Base.clone.call(this);
- clone.words = this.words.slice(0);
-
- return clone;
- },
-
- /**
- * Creates a word array filled with random bytes.
- *
- * @param {number} nBytes The number of random bytes to generate.
- *
- * @return {WordArray} The random word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.lib.WordArray.random(16);
- */
- random: function (nBytes) {
- var words = [];
-
- for (var i = 0; i < nBytes; i += 4) {
- words.push(cryptoSecureRandomInt());
- }
-
- return new WordArray.init(words, nBytes);
- }
- });
-
- /**
- * Encoder namespace.
- */
- var C_enc = C.enc = {};
-
- /**
- * Hex encoding strategy.
- */
- var Hex = C_enc.Hex = {
- /**
- * Converts a word array to a hex string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The hex string.
- *
- * @static
- *
- * @example
- *
- * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
- */
- stringify: function (wordArray) {
- // Shortcuts
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
-
- // Convert
- var hexChars = [];
- for (var i = 0; i < sigBytes; i++) {
- var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
- hexChars.push((bite >>> 4).toString(16));
- hexChars.push((bite & 0x0f).toString(16));
- }
-
- return hexChars.join('');
- },
-
- /**
- * Converts a hex string to a word array.
- *
- * @param {string} hexStr The hex string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Hex.parse(hexString);
- */
- parse: function (hexStr) {
- // Shortcut
- var hexStrLength = hexStr.length;
-
- // Convert
- var words = [];
- for (var i = 0; i < hexStrLength; i += 2) {
- words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
- }
-
- return new WordArray.init(words, hexStrLength / 2);
- }
- };
-
- /**
- * Latin1 encoding strategy.
- */
- var Latin1 = C_enc.Latin1 = {
- /**
- * Converts a word array to a Latin1 string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The Latin1 string.
- *
- * @static
- *
- * @example
- *
- * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
- */
- stringify: function (wordArray) {
- // Shortcuts
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
-
- // Convert
- var latin1Chars = [];
- for (var i = 0; i < sigBytes; i++) {
- var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
- latin1Chars.push(String.fromCharCode(bite));
- }
-
- return latin1Chars.join('');
- },
-
- /**
- * Converts a Latin1 string to a word array.
- *
- * @param {string} latin1Str The Latin1 string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
- */
- parse: function (latin1Str) {
- // Shortcut
- var latin1StrLength = latin1Str.length;
-
- // Convert
- var words = [];
- for (var i = 0; i < latin1StrLength; i++) {
- words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
- }
-
- return new WordArray.init(words, latin1StrLength);
- }
- };
-
- /**
- * UTF-8 encoding strategy.
- */
- var Utf8 = C_enc.Utf8 = {
- /**
- * Converts a word array to a UTF-8 string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The UTF-8 string.
- *
- * @static
- *
- * @example
- *
- * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
- */
- stringify: function (wordArray) {
- try {
- return decodeURIComponent(escape(Latin1.stringify(wordArray)));
- } catch (e) {
- throw new Error('Malformed UTF-8 data');
- }
- },
-
- /**
- * Converts a UTF-8 string to a word array.
- *
- * @param {string} utf8Str The UTF-8 string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
- */
- parse: function (utf8Str) {
- return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
- }
- };
-
- /**
- * Abstract buffered block algorithm template.
- *
- * The property blockSize must be implemented in a concrete subtype.
- *
- * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
- */
- var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
- /**
- * Resets this block algorithm's data buffer to its initial state.
- *
- * @example
- *
- * bufferedBlockAlgorithm.reset();
- */
- reset: function () {
- // Initial values
- this._data = new WordArray.init();
- this._nDataBytes = 0;
- },
-
- /**
- * Adds new data to this block algorithm's buffer.
- *
- * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
- *
- * @example
- *
- * bufferedBlockAlgorithm._append('data');
- * bufferedBlockAlgorithm._append(wordArray);
- */
- _append: function (data) {
- // Convert string to WordArray, else assume WordArray already
- if (typeof data == 'string') {
- data = Utf8.parse(data);
- }
-
- // Append
- this._data.concat(data);
- this._nDataBytes += data.sigBytes;
- },
-
- /**
- * Processes available data blocks.
- *
- * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
- *
- * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
- *
- * @return {WordArray} The processed data.
- *
- * @example
- *
- * var processedData = bufferedBlockAlgorithm._process();
- * var processedData = bufferedBlockAlgorithm._process(!!'flush');
- */
- _process: function (doFlush) {
- var processedWords;
-
- // Shortcuts
- var data = this._data;
- var dataWords = data.words;
- var dataSigBytes = data.sigBytes;
- var blockSize = this.blockSize;
- var blockSizeBytes = blockSize * 4;
-
- // Count blocks ready
- var nBlocksReady = dataSigBytes / blockSizeBytes;
- if (doFlush) {
- // Round up to include partial blocks
- nBlocksReady = Math.ceil(nBlocksReady);
- } else {
- // Round down to include only full blocks,
- // less the number of blocks that must remain in the buffer
- nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
- }
-
- // Count words ready
- var nWordsReady = nBlocksReady * blockSize;
-
- // Count bytes ready
- var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
-
- // Process blocks
- if (nWordsReady) {
- for (var offset = 0; offset < nWordsReady; offset += blockSize) {
- // Perform concrete-algorithm logic
- this._doProcessBlock(dataWords, offset);
- }
-
- // Remove processed words
- processedWords = dataWords.splice(0, nWordsReady);
- data.sigBytes -= nBytesReady;
- }
-
- // Return processed words
- return new WordArray.init(processedWords, nBytesReady);
- },
-
- /**
- * Creates a copy of this object.
- *
- * @return {Object} The clone.
- *
- * @example
- *
- * var clone = bufferedBlockAlgorithm.clone();
- */
- clone: function () {
- var clone = Base.clone.call(this);
- clone._data = this._data.clone();
-
- return clone;
- },
-
- _minBufferSize: 0
- });
-
- /**
- * Abstract hasher template.
- *
- * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
- */
- var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
- /**
- * Configuration options.
- */
- cfg: Base.extend(),
-
- /**
- * Initializes a newly created hasher.
- *
- * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
- *
- * @example
- *
- * var hasher = CryptoJS.algo.SHA256.create();
- */
- init: function (cfg) {
- // Apply config defaults
- this.cfg = this.cfg.extend(cfg);
-
- // Set initial values
- this.reset();
- },
-
- /**
- * Resets this hasher to its initial state.
- *
- * @example
- *
- * hasher.reset();
- */
- reset: function () {
- // Reset data buffer
- BufferedBlockAlgorithm.reset.call(this);
-
- // Perform concrete-hasher logic
- this._doReset();
- },
-
- /**
- * Updates this hasher with a message.
- *
- * @param {WordArray|string} messageUpdate The message to append.
- *
- * @return {Hasher} This hasher.
- *
- * @example
- *
- * hasher.update('message');
- * hasher.update(wordArray);
- */
- update: function (messageUpdate) {
- // Append
- this._append(messageUpdate);
-
- // Update the hash
- this._process();
-
- // Chainable
- return this;
- },
-
- /**
- * Finalizes the hash computation.
- * Note that the finalize operation is effectively a destructive, read-once operation.
- *
- * @param {WordArray|string} messageUpdate (Optional) A final message update.
- *
- * @return {WordArray} The hash.
- *
- * @example
- *
- * var hash = hasher.finalize();
- * var hash = hasher.finalize('message');
- * var hash = hasher.finalize(wordArray);
- */
- finalize: function (messageUpdate) {
- // Final message update
- if (messageUpdate) {
- this._append(messageUpdate);
- }
-
- // Perform concrete-hasher logic
- var hash = this._doFinalize();
-
- return hash;
- },
-
- blockSize: 512/32,
-
- /**
- * Creates a shortcut function to a hasher's object interface.
- *
- * @param {Hasher} hasher The hasher to create a helper for.
- *
- * @return {Function} The shortcut function.
- *
- * @static
- *
- * @example
- *
- * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
- */
- _createHelper: function (hasher) {
- return function (message, cfg) {
- return new hasher.init(cfg).finalize(message);
- };
- },
-
- /**
- * Creates a shortcut function to the HMAC's object interface.
- *
- * @param {Hasher} hasher The hasher to use in this HMAC helper.
- *
- * @return {Function} The shortcut function.
- *
- * @static
- *
- * @example
- *
- * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
- */
- _createHmacHelper: function (hasher) {
- return function (message, key) {
- return new C_algo.HMAC.init(hasher, key).finalize(message);
- };
- }
- });
-
- /**
- * Algorithm namespace.
- */
- var C_algo = C.algo = {};
-
- return C;
- }(Math));
-
-
- return CryptoJS;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/enc-base64.js":
-/*!**********************************************!*\
- !*** ./node_modules/crypto-js/enc-base64.js ***!
- \**********************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var C_enc = C.enc;
-
- /**
- * Base64 encoding strategy.
- */
- var Base64 = C_enc.Base64 = {
- /**
- * Converts a word array to a Base64 string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The Base64 string.
- *
- * @static
- *
- * @example
- *
- * var base64String = CryptoJS.enc.Base64.stringify(wordArray);
- */
- stringify: function (wordArray) {
- // Shortcuts
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
- var map = this._map;
-
- // Clamp excess bits
- wordArray.clamp();
-
- // Convert
- var base64Chars = [];
- for (var i = 0; i < sigBytes; i += 3) {
- var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
- var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
- var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
-
- var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
-
- for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
- base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
- }
- }
-
- // Add padding
- var paddingChar = map.charAt(64);
- if (paddingChar) {
- while (base64Chars.length % 4) {
- base64Chars.push(paddingChar);
- }
- }
-
- return base64Chars.join('');
- },
-
- /**
- * Converts a Base64 string to a word array.
- *
- * @param {string} base64Str The Base64 string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Base64.parse(base64String);
- */
- parse: function (base64Str) {
- // Shortcuts
- var base64StrLength = base64Str.length;
- var map = this._map;
- var reverseMap = this._reverseMap;
-
- if (!reverseMap) {
- reverseMap = this._reverseMap = [];
- for (var j = 0; j < map.length; j++) {
- reverseMap[map.charCodeAt(j)] = j;
- }
- }
-
- // Ignore padding
- var paddingChar = map.charAt(64);
- if (paddingChar) {
- var paddingIndex = base64Str.indexOf(paddingChar);
- if (paddingIndex !== -1) {
- base64StrLength = paddingIndex;
- }
- }
-
- // Convert
- return parseLoop(base64Str, base64StrLength, reverseMap);
-
- },
-
- _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
- };
-
- function parseLoop(base64Str, base64StrLength, reverseMap) {
- var words = [];
- var nBytes = 0;
- for (var i = 0; i < base64StrLength; i++) {
- if (i % 4) {
- var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);
- var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);
- var bitsCombined = bits1 | bits2;
- words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);
- nBytes++;
- }
- }
- return WordArray.create(words, nBytes);
- }
- }());
-
-
- return CryptoJS.enc.Base64;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/enc-base64url.js":
-/*!*************************************************!*\
- !*** ./node_modules/crypto-js/enc-base64url.js ***!
- \*************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var C_enc = C.enc;
-
- /**
- * Base64url encoding strategy.
- */
- var Base64url = C_enc.Base64url = {
- /**
- * Converts a word array to a Base64url string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @param {boolean} urlSafe Whether to use url safe
- *
- * @return {string} The Base64url string.
- *
- * @static
- *
- * @example
- *
- * var base64String = CryptoJS.enc.Base64url.stringify(wordArray);
- */
- stringify: function (wordArray, urlSafe=true) {
- // Shortcuts
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
- var map = urlSafe ? this._safe_map : this._map;
-
- // Clamp excess bits
- wordArray.clamp();
-
- // Convert
- var base64Chars = [];
- for (var i = 0; i < sigBytes; i += 3) {
- var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
- var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
- var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
-
- var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
-
- for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
- base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
- }
- }
-
- // Add padding
- var paddingChar = map.charAt(64);
- if (paddingChar) {
- while (base64Chars.length % 4) {
- base64Chars.push(paddingChar);
- }
- }
-
- return base64Chars.join('');
- },
-
- /**
- * Converts a Base64url string to a word array.
- *
- * @param {string} base64Str The Base64url string.
- *
- * @param {boolean} urlSafe Whether to use url safe
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Base64url.parse(base64String);
- */
- parse: function (base64Str, urlSafe=true) {
- // Shortcuts
- var base64StrLength = base64Str.length;
- var map = urlSafe ? this._safe_map : this._map;
- var reverseMap = this._reverseMap;
-
- if (!reverseMap) {
- reverseMap = this._reverseMap = [];
- for (var j = 0; j < map.length; j++) {
- reverseMap[map.charCodeAt(j)] = j;
- }
- }
-
- // Ignore padding
- var paddingChar = map.charAt(64);
- if (paddingChar) {
- var paddingIndex = base64Str.indexOf(paddingChar);
- if (paddingIndex !== -1) {
- base64StrLength = paddingIndex;
- }
- }
-
- // Convert
- return parseLoop(base64Str, base64StrLength, reverseMap);
-
- },
-
- _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
- _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',
- };
-
- function parseLoop(base64Str, base64StrLength, reverseMap) {
- var words = [];
- var nBytes = 0;
- for (var i = 0; i < base64StrLength; i++) {
- if (i % 4) {
- var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);
- var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);
- var bitsCombined = bits1 | bits2;
- words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);
- nBytes++;
- }
- }
- return WordArray.create(words, nBytes);
- }
- }());
-
- return CryptoJS.enc.Base64url;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/enc-utf16.js":
-/*!*********************************************!*\
- !*** ./node_modules/crypto-js/enc-utf16.js ***!
- \*********************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var C_enc = C.enc;
-
- /**
- * UTF-16 BE encoding strategy.
- */
- var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {
- /**
- * Converts a word array to a UTF-16 BE string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The UTF-16 BE string.
- *
- * @static
- *
- * @example
- *
- * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
- */
- stringify: function (wordArray) {
- // Shortcuts
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
-
- // Convert
- var utf16Chars = [];
- for (var i = 0; i < sigBytes; i += 2) {
- var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
- utf16Chars.push(String.fromCharCode(codePoint));
- }
-
- return utf16Chars.join('');
- },
-
- /**
- * Converts a UTF-16 BE string to a word array.
- *
- * @param {string} utf16Str The UTF-16 BE string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
- */
- parse: function (utf16Str) {
- // Shortcut
- var utf16StrLength = utf16Str.length;
-
- // Convert
- var words = [];
- for (var i = 0; i < utf16StrLength; i++) {
- words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
- }
-
- return WordArray.create(words, utf16StrLength * 2);
- }
- };
-
- /**
- * UTF-16 LE encoding strategy.
- */
- C_enc.Utf16LE = {
- /**
- * Converts a word array to a UTF-16 LE string.
- *
- * @param {WordArray} wordArray The word array.
- *
- * @return {string} The UTF-16 LE string.
- *
- * @static
- *
- * @example
- *
- * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
- */
- stringify: function (wordArray) {
- // Shortcuts
- var words = wordArray.words;
- var sigBytes = wordArray.sigBytes;
-
- // Convert
- var utf16Chars = [];
- for (var i = 0; i < sigBytes; i += 2) {
- var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);
- utf16Chars.push(String.fromCharCode(codePoint));
- }
-
- return utf16Chars.join('');
- },
-
- /**
- * Converts a UTF-16 LE string to a word array.
- *
- * @param {string} utf16Str The UTF-16 LE string.
- *
- * @return {WordArray} The word array.
- *
- * @static
- *
- * @example
- *
- * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
- */
- parse: function (utf16Str) {
- // Shortcut
- var utf16StrLength = utf16Str.length;
-
- // Convert
- var words = [];
- for (var i = 0; i < utf16StrLength; i++) {
- words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));
- }
-
- return WordArray.create(words, utf16StrLength * 2);
- }
- };
-
- function swapEndian(word) {
- return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);
- }
- }());
-
-
- return CryptoJS.enc.Utf16;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/evpkdf.js":
-/*!******************************************!*\
- !*** ./node_modules/crypto-js/evpkdf.js ***!
- \******************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var Base = C_lib.Base;
- var WordArray = C_lib.WordArray;
- var C_algo = C.algo;
- var MD5 = C_algo.MD5;
-
- /**
- * This key derivation function is meant to conform with EVP_BytesToKey.
- * www.openssl.org/docs/crypto/EVP_BytesToKey.html
- */
- var EvpKDF = C_algo.EvpKDF = Base.extend({
- /**
- * Configuration options.
- *
- * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
- * @property {Hasher} hasher The hash algorithm to use. Default: MD5
- * @property {number} iterations The number of iterations to perform. Default: 1
- */
- cfg: Base.extend({
- keySize: 128/32,
- hasher: MD5,
- iterations: 1
- }),
-
- /**
- * Initializes a newly created key derivation function.
- *
- * @param {Object} cfg (Optional) The configuration options to use for the derivation.
- *
- * @example
- *
- * var kdf = CryptoJS.algo.EvpKDF.create();
- * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
- * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
- */
- init: function (cfg) {
- this.cfg = this.cfg.extend(cfg);
- },
-
- /**
- * Derives a key from a password.
- *
- * @param {WordArray|string} password The password.
- * @param {WordArray|string} salt A salt.
- *
- * @return {WordArray} The derived key.
- *
- * @example
- *
- * var key = kdf.compute(password, salt);
- */
- compute: function (password, salt) {
- var block;
-
- // Shortcut
- var cfg = this.cfg;
-
- // Init hasher
- var hasher = cfg.hasher.create();
-
- // Initial values
- var derivedKey = WordArray.create();
-
- // Shortcuts
- var derivedKeyWords = derivedKey.words;
- var keySize = cfg.keySize;
- var iterations = cfg.iterations;
-
- // Generate key
- while (derivedKeyWords.length < keySize) {
- if (block) {
- hasher.update(block);
- }
- block = hasher.update(password).finalize(salt);
- hasher.reset();
-
- // Iterations
- for (var i = 1; i < iterations; i++) {
- block = hasher.finalize(block);
- hasher.reset();
- }
-
- derivedKey.concat(block);
- }
- derivedKey.sigBytes = keySize * 4;
-
- return derivedKey;
- }
- });
-
- /**
- * Derives a key from a password.
- *
- * @param {WordArray|string} password The password.
- * @param {WordArray|string} salt A salt.
- * @param {Object} cfg (Optional) The configuration options to use for this computation.
- *
- * @return {WordArray} The derived key.
- *
- * @static
- *
- * @example
- *
- * var key = CryptoJS.EvpKDF(password, salt);
- * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
- * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
- */
- C.EvpKDF = function (password, salt, cfg) {
- return EvpKDF.create(cfg).compute(password, salt);
- };
- }());
-
-
- return CryptoJS.EvpKDF;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/format-hex.js":
-/*!**********************************************!*\
- !*** ./node_modules/crypto-js/format-hex.js ***!
- \**********************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function (undefined) {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var CipherParams = C_lib.CipherParams;
- var C_enc = C.enc;
- var Hex = C_enc.Hex;
- var C_format = C.format;
-
- var HexFormatter = C_format.Hex = {
- /**
- * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
- *
- * @param {CipherParams} cipherParams The cipher params object.
- *
- * @return {string} The hexadecimally encoded string.
- *
- * @static
- *
- * @example
- *
- * var hexString = CryptoJS.format.Hex.stringify(cipherParams);
- */
- stringify: function (cipherParams) {
- return cipherParams.ciphertext.toString(Hex);
- },
-
- /**
- * Converts a hexadecimally encoded ciphertext string to a cipher params object.
- *
- * @param {string} input The hexadecimally encoded string.
- *
- * @return {CipherParams} The cipher params object.
- *
- * @static
- *
- * @example
- *
- * var cipherParams = CryptoJS.format.Hex.parse(hexString);
- */
- parse: function (input) {
- var ciphertext = Hex.parse(input);
- return CipherParams.create({ ciphertext: ciphertext });
- }
- };
- }());
-
-
- return CryptoJS.format.Hex;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/hmac.js":
-/*!****************************************!*\
- !*** ./node_modules/crypto-js/hmac.js ***!
- \****************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var Base = C_lib.Base;
- var C_enc = C.enc;
- var Utf8 = C_enc.Utf8;
- var C_algo = C.algo;
-
- /**
- * HMAC algorithm.
- */
- var HMAC = C_algo.HMAC = Base.extend({
- /**
- * Initializes a newly created HMAC.
- *
- * @param {Hasher} hasher The hash algorithm to use.
- * @param {WordArray|string} key The secret key.
- *
- * @example
- *
- * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
- */
- init: function (hasher, key) {
- // Init hasher
- hasher = this._hasher = new hasher.init();
-
- // Convert string to WordArray, else assume WordArray already
- if (typeof key == 'string') {
- key = Utf8.parse(key);
- }
-
- // Shortcuts
- var hasherBlockSize = hasher.blockSize;
- var hasherBlockSizeBytes = hasherBlockSize * 4;
-
- // Allow arbitrary length keys
- if (key.sigBytes > hasherBlockSizeBytes) {
- key = hasher.finalize(key);
- }
-
- // Clamp excess bits
- key.clamp();
-
- // Clone key for inner and outer pads
- var oKey = this._oKey = key.clone();
- var iKey = this._iKey = key.clone();
-
- // Shortcuts
- var oKeyWords = oKey.words;
- var iKeyWords = iKey.words;
-
- // XOR keys with pad constants
- for (var i = 0; i < hasherBlockSize; i++) {
- oKeyWords[i] ^= 0x5c5c5c5c;
- iKeyWords[i] ^= 0x36363636;
- }
- oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
-
- // Set initial values
- this.reset();
- },
-
- /**
- * Resets this HMAC to its initial state.
- *
- * @example
- *
- * hmacHasher.reset();
- */
- reset: function () {
- // Shortcut
- var hasher = this._hasher;
-
- // Reset
- hasher.reset();
- hasher.update(this._iKey);
- },
-
- /**
- * Updates this HMAC with a message.
- *
- * @param {WordArray|string} messageUpdate The message to append.
- *
- * @return {HMAC} This HMAC instance.
- *
- * @example
- *
- * hmacHasher.update('message');
- * hmacHasher.update(wordArray);
- */
- update: function (messageUpdate) {
- this._hasher.update(messageUpdate);
-
- // Chainable
- return this;
- },
-
- /**
- * Finalizes the HMAC computation.
- * Note that the finalize operation is effectively a destructive, read-once operation.
- *
- * @param {WordArray|string} messageUpdate (Optional) A final message update.
- *
- * @return {WordArray} The HMAC.
- *
- * @example
- *
- * var hmac = hmacHasher.finalize();
- * var hmac = hmacHasher.finalize('message');
- * var hmac = hmacHasher.finalize(wordArray);
- */
- finalize: function (messageUpdate) {
- // Shortcut
- var hasher = this._hasher;
-
- // Compute HMAC
- var innerHash = hasher.finalize(messageUpdate);
- hasher.reset();
- var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
-
- return hmac;
- }
- });
- }());
-
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/index.js":
-/*!*****************************************!*\
- !*** ./node_modules/crypto-js/index.js ***!
- \*****************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./lib-typedarrays */ "./node_modules/crypto-js/lib-typedarrays.js"), __webpack_require__(/*! ./enc-utf16 */ "./node_modules/crypto-js/enc-utf16.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./enc-base64url */ "./node_modules/crypto-js/enc-base64url.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js"), __webpack_require__(/*! ./sha224 */ "./node_modules/crypto-js/sha224.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js"), __webpack_require__(/*! ./sha384 */ "./node_modules/crypto-js/sha384.js"), __webpack_require__(/*! ./sha3 */ "./node_modules/crypto-js/sha3.js"), __webpack_require__(/*! ./ripemd160 */ "./node_modules/crypto-js/ripemd160.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js"), __webpack_require__(/*! ./pbkdf2 */ "./node_modules/crypto-js/pbkdf2.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"), __webpack_require__(/*! ./mode-cfb */ "./node_modules/crypto-js/mode-cfb.js"), __webpack_require__(/*! ./mode-ctr */ "./node_modules/crypto-js/mode-ctr.js"), __webpack_require__(/*! ./mode-ctr-gladman */ "./node_modules/crypto-js/mode-ctr-gladman.js"), __webpack_require__(/*! ./mode-ofb */ "./node_modules/crypto-js/mode-ofb.js"), __webpack_require__(/*! ./mode-ecb */ "./node_modules/crypto-js/mode-ecb.js"), __webpack_require__(/*! ./pad-ansix923 */ "./node_modules/crypto-js/pad-ansix923.js"), __webpack_require__(/*! ./pad-iso10126 */ "./node_modules/crypto-js/pad-iso10126.js"), __webpack_require__(/*! ./pad-iso97971 */ "./node_modules/crypto-js/pad-iso97971.js"), __webpack_require__(/*! ./pad-zeropadding */ "./node_modules/crypto-js/pad-zeropadding.js"), __webpack_require__(/*! ./pad-nopadding */ "./node_modules/crypto-js/pad-nopadding.js"), __webpack_require__(/*! ./format-hex */ "./node_modules/crypto-js/format-hex.js"), __webpack_require__(/*! ./aes */ "./node_modules/crypto-js/aes.js"), __webpack_require__(/*! ./tripledes */ "./node_modules/crypto-js/tripledes.js"), __webpack_require__(/*! ./rc4 */ "./node_modules/crypto-js/rc4.js"), __webpack_require__(/*! ./rabbit */ "./node_modules/crypto-js/rabbit.js"), __webpack_require__(/*! ./rabbit-legacy */ "./node_modules/crypto-js/rabbit-legacy.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- return CryptoJS;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/lib-typedarrays.js":
-/*!***************************************************!*\
- !*** ./node_modules/crypto-js/lib-typedarrays.js ***!
- \***************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Check if typed arrays are supported
- if (typeof ArrayBuffer != 'function') {
- return;
- }
-
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
-
- // Reference original init
- var superInit = WordArray.init;
-
- // Augment WordArray.init to handle typed arrays
- var subInit = WordArray.init = function (typedArray) {
- // Convert buffers to uint8
- if (typedArray instanceof ArrayBuffer) {
- typedArray = new Uint8Array(typedArray);
- }
-
- // Convert other array views to uint8
- if (
- typedArray instanceof Int8Array ||
- (typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) ||
- typedArray instanceof Int16Array ||
- typedArray instanceof Uint16Array ||
- typedArray instanceof Int32Array ||
- typedArray instanceof Uint32Array ||
- typedArray instanceof Float32Array ||
- typedArray instanceof Float64Array
- ) {
- typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
- }
-
- // Handle Uint8Array
- if (typedArray instanceof Uint8Array) {
- // Shortcut
- var typedArrayByteLength = typedArray.byteLength;
-
- // Extract bytes
- var words = [];
- for (var i = 0; i < typedArrayByteLength; i++) {
- words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
- }
-
- // Initialize this word array
- superInit.call(this, words, typedArrayByteLength);
- } else {
- // Else call normal init
- superInit.apply(this, arguments);
- }
- };
-
- subInit.prototype = WordArray;
- }());
-
-
- return CryptoJS.lib.WordArray;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/md5.js":
-/*!***************************************!*\
- !*** ./node_modules/crypto-js/md5.js ***!
- \***************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function (Math) {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var Hasher = C_lib.Hasher;
- var C_algo = C.algo;
-
- // Constants table
- var T = [];
-
- // Compute constants
- (function () {
- for (var i = 0; i < 64; i++) {
- T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
- }
- }());
-
- /**
- * MD5 hash algorithm.
- */
- var MD5 = C_algo.MD5 = Hasher.extend({
- _doReset: function () {
- this._hash = new WordArray.init([
- 0x67452301, 0xefcdab89,
- 0x98badcfe, 0x10325476
- ]);
- },
-
- _doProcessBlock: function (M, offset) {
- // Swap endian
- for (var i = 0; i < 16; i++) {
- // Shortcuts
- var offset_i = offset + i;
- var M_offset_i = M[offset_i];
-
- M[offset_i] = (
- (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
- (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
- );
- }
-
- // Shortcuts
- var H = this._hash.words;
-
- var M_offset_0 = M[offset + 0];
- var M_offset_1 = M[offset + 1];
- var M_offset_2 = M[offset + 2];
- var M_offset_3 = M[offset + 3];
- var M_offset_4 = M[offset + 4];
- var M_offset_5 = M[offset + 5];
- var M_offset_6 = M[offset + 6];
- var M_offset_7 = M[offset + 7];
- var M_offset_8 = M[offset + 8];
- var M_offset_9 = M[offset + 9];
- var M_offset_10 = M[offset + 10];
- var M_offset_11 = M[offset + 11];
- var M_offset_12 = M[offset + 12];
- var M_offset_13 = M[offset + 13];
- var M_offset_14 = M[offset + 14];
- var M_offset_15 = M[offset + 15];
-
- // Working varialbes
- var a = H[0];
- var b = H[1];
- var c = H[2];
- var d = H[3];
-
- // Computation
- a = FF(a, b, c, d, M_offset_0, 7, T[0]);
- d = FF(d, a, b, c, M_offset_1, 12, T[1]);
- c = FF(c, d, a, b, M_offset_2, 17, T[2]);
- b = FF(b, c, d, a, M_offset_3, 22, T[3]);
- a = FF(a, b, c, d, M_offset_4, 7, T[4]);
- d = FF(d, a, b, c, M_offset_5, 12, T[5]);
- c = FF(c, d, a, b, M_offset_6, 17, T[6]);
- b = FF(b, c, d, a, M_offset_7, 22, T[7]);
- a = FF(a, b, c, d, M_offset_8, 7, T[8]);
- d = FF(d, a, b, c, M_offset_9, 12, T[9]);
- c = FF(c, d, a, b, M_offset_10, 17, T[10]);
- b = FF(b, c, d, a, M_offset_11, 22, T[11]);
- a = FF(a, b, c, d, M_offset_12, 7, T[12]);
- d = FF(d, a, b, c, M_offset_13, 12, T[13]);
- c = FF(c, d, a, b, M_offset_14, 17, T[14]);
- b = FF(b, c, d, a, M_offset_15, 22, T[15]);
-
- a = GG(a, b, c, d, M_offset_1, 5, T[16]);
- d = GG(d, a, b, c, M_offset_6, 9, T[17]);
- c = GG(c, d, a, b, M_offset_11, 14, T[18]);
- b = GG(b, c, d, a, M_offset_0, 20, T[19]);
- a = GG(a, b, c, d, M_offset_5, 5, T[20]);
- d = GG(d, a, b, c, M_offset_10, 9, T[21]);
- c = GG(c, d, a, b, M_offset_15, 14, T[22]);
- b = GG(b, c, d, a, M_offset_4, 20, T[23]);
- a = GG(a, b, c, d, M_offset_9, 5, T[24]);
- d = GG(d, a, b, c, M_offset_14, 9, T[25]);
- c = GG(c, d, a, b, M_offset_3, 14, T[26]);
- b = GG(b, c, d, a, M_offset_8, 20, T[27]);
- a = GG(a, b, c, d, M_offset_13, 5, T[28]);
- d = GG(d, a, b, c, M_offset_2, 9, T[29]);
- c = GG(c, d, a, b, M_offset_7, 14, T[30]);
- b = GG(b, c, d, a, M_offset_12, 20, T[31]);
-
- a = HH(a, b, c, d, M_offset_5, 4, T[32]);
- d = HH(d, a, b, c, M_offset_8, 11, T[33]);
- c = HH(c, d, a, b, M_offset_11, 16, T[34]);
- b = HH(b, c, d, a, M_offset_14, 23, T[35]);
- a = HH(a, b, c, d, M_offset_1, 4, T[36]);
- d = HH(d, a, b, c, M_offset_4, 11, T[37]);
- c = HH(c, d, a, b, M_offset_7, 16, T[38]);
- b = HH(b, c, d, a, M_offset_10, 23, T[39]);
- a = HH(a, b, c, d, M_offset_13, 4, T[40]);
- d = HH(d, a, b, c, M_offset_0, 11, T[41]);
- c = HH(c, d, a, b, M_offset_3, 16, T[42]);
- b = HH(b, c, d, a, M_offset_6, 23, T[43]);
- a = HH(a, b, c, d, M_offset_9, 4, T[44]);
- d = HH(d, a, b, c, M_offset_12, 11, T[45]);
- c = HH(c, d, a, b, M_offset_15, 16, T[46]);
- b = HH(b, c, d, a, M_offset_2, 23, T[47]);
-
- a = II(a, b, c, d, M_offset_0, 6, T[48]);
- d = II(d, a, b, c, M_offset_7, 10, T[49]);
- c = II(c, d, a, b, M_offset_14, 15, T[50]);
- b = II(b, c, d, a, M_offset_5, 21, T[51]);
- a = II(a, b, c, d, M_offset_12, 6, T[52]);
- d = II(d, a, b, c, M_offset_3, 10, T[53]);
- c = II(c, d, a, b, M_offset_10, 15, T[54]);
- b = II(b, c, d, a, M_offset_1, 21, T[55]);
- a = II(a, b, c, d, M_offset_8, 6, T[56]);
- d = II(d, a, b, c, M_offset_15, 10, T[57]);
- c = II(c, d, a, b, M_offset_6, 15, T[58]);
- b = II(b, c, d, a, M_offset_13, 21, T[59]);
- a = II(a, b, c, d, M_offset_4, 6, T[60]);
- d = II(d, a, b, c, M_offset_11, 10, T[61]);
- c = II(c, d, a, b, M_offset_2, 15, T[62]);
- b = II(b, c, d, a, M_offset_9, 21, T[63]);
-
- // Intermediate hash value
- H[0] = (H[0] + a) | 0;
- H[1] = (H[1] + b) | 0;
- H[2] = (H[2] + c) | 0;
- H[3] = (H[3] + d) | 0;
- },
-
- _doFinalize: function () {
- // Shortcuts
- var data = this._data;
- var dataWords = data.words;
-
- var nBitsTotal = this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
-
- // Add padding
- dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
-
- var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
- var nBitsTotalL = nBitsTotal;
- dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
- (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |
- (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)
- );
- dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
- (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |
- (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)
- );
-
- data.sigBytes = (dataWords.length + 1) * 4;
-
- // Hash final blocks
- this._process();
-
- // Shortcuts
- var hash = this._hash;
- var H = hash.words;
-
- // Swap endian
- for (var i = 0; i < 4; i++) {
- // Shortcut
- var H_i = H[i];
-
- H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
- (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
- }
-
- // Return final computed hash
- return hash;
- },
-
- clone: function () {
- var clone = Hasher.clone.call(this);
- clone._hash = this._hash.clone();
-
- return clone;
- }
- });
-
- function FF(a, b, c, d, x, s, t) {
- var n = a + ((b & c) | (~b & d)) + x + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- }
-
- function GG(a, b, c, d, x, s, t) {
- var n = a + ((b & d) | (c & ~d)) + x + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- }
-
- function HH(a, b, c, d, x, s, t) {
- var n = a + (b ^ c ^ d) + x + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- }
-
- function II(a, b, c, d, x, s, t) {
- var n = a + (c ^ (b | ~d)) + x + t;
- return ((n << s) | (n >>> (32 - s))) + b;
- }
-
- /**
- * Shortcut function to the hasher's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- *
- * @return {WordArray} The hash.
- *
- * @static
- *
- * @example
- *
- * var hash = CryptoJS.MD5('message');
- * var hash = CryptoJS.MD5(wordArray);
- */
- C.MD5 = Hasher._createHelper(MD5);
-
- /**
- * Shortcut function to the HMAC's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- * @param {WordArray|string} key The secret key.
- *
- * @return {WordArray} The HMAC.
- *
- * @static
- *
- * @example
- *
- * var hmac = CryptoJS.HmacMD5(message, key);
- */
- C.HmacMD5 = Hasher._createHmacHelper(MD5);
- }(Math));
-
-
- return CryptoJS.MD5;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/mode-cfb.js":
-/*!********************************************!*\
- !*** ./node_modules/crypto-js/mode-cfb.js ***!
- \********************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /**
- * Cipher Feedback block mode.
- */
- CryptoJS.mode.CFB = (function () {
- var CFB = CryptoJS.lib.BlockCipherMode.extend();
-
- CFB.Encryptor = CFB.extend({
- processBlock: function (words, offset) {
- // Shortcuts
- var cipher = this._cipher;
- var blockSize = cipher.blockSize;
-
- generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
-
- // Remember this block to use with next block
- this._prevBlock = words.slice(offset, offset + blockSize);
- }
- });
-
- CFB.Decryptor = CFB.extend({
- processBlock: function (words, offset) {
- // Shortcuts
- var cipher = this._cipher;
- var blockSize = cipher.blockSize;
-
- // Remember this block to use with next block
- var thisBlock = words.slice(offset, offset + blockSize);
-
- generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
-
- // This block becomes the previous block
- this._prevBlock = thisBlock;
- }
- });
-
- function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
- var keystream;
-
- // Shortcut
- var iv = this._iv;
-
- // Generate keystream
- if (iv) {
- keystream = iv.slice(0);
-
- // Remove IV for subsequent blocks
- this._iv = undefined;
- } else {
- keystream = this._prevBlock;
- }
- cipher.encryptBlock(keystream, 0);
-
- // Encrypt
- for (var i = 0; i < blockSize; i++) {
- words[offset + i] ^= keystream[i];
- }
- }
-
- return CFB;
- }());
-
-
- return CryptoJS.mode.CFB;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/mode-ctr-gladman.js":
-/*!****************************************************!*\
- !*** ./node_modules/crypto-js/mode-ctr-gladman.js ***!
- \****************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /** @preserve
- * Counter block mode compatible with Dr Brian Gladman fileenc.c
- * derived from CryptoJS.mode.CTR
- * Jan Hruby jhruby.web@gmail.com
- */
- CryptoJS.mode.CTRGladman = (function () {
- var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
-
- function incWord(word)
- {
- if (((word >> 24) & 0xff) === 0xff) { //overflow
- var b1 = (word >> 16)&0xff;
- var b2 = (word >> 8)&0xff;
- var b3 = word & 0xff;
-
- if (b1 === 0xff) // overflow b1
- {
- b1 = 0;
- if (b2 === 0xff)
- {
- b2 = 0;
- if (b3 === 0xff)
- {
- b3 = 0;
- }
- else
- {
- ++b3;
- }
- }
- else
- {
- ++b2;
- }
- }
- else
- {
- ++b1;
- }
-
- word = 0;
- word += (b1 << 16);
- word += (b2 << 8);
- word += b3;
- }
- else
- {
- word += (0x01 << 24);
- }
- return word;
- }
-
- function incCounter(counter)
- {
- if ((counter[0] = incWord(counter[0])) === 0)
- {
- // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8
- counter[1] = incWord(counter[1]);
- }
- return counter;
- }
-
- var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
- processBlock: function (words, offset) {
- // Shortcuts
- var cipher = this._cipher
- var blockSize = cipher.blockSize;
- var iv = this._iv;
- var counter = this._counter;
-
- // Generate keystream
- if (iv) {
- counter = this._counter = iv.slice(0);
-
- // Remove IV for subsequent blocks
- this._iv = undefined;
- }
-
- incCounter(counter);
-
- var keystream = counter.slice(0);
- cipher.encryptBlock(keystream, 0);
-
- // Encrypt
- for (var i = 0; i < blockSize; i++) {
- words[offset + i] ^= keystream[i];
- }
- }
- });
-
- CTRGladman.Decryptor = Encryptor;
-
- return CTRGladman;
- }());
-
-
-
-
- return CryptoJS.mode.CTRGladman;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/mode-ctr.js":
-/*!********************************************!*\
- !*** ./node_modules/crypto-js/mode-ctr.js ***!
- \********************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /**
- * Counter block mode.
- */
- CryptoJS.mode.CTR = (function () {
- var CTR = CryptoJS.lib.BlockCipherMode.extend();
-
- var Encryptor = CTR.Encryptor = CTR.extend({
- processBlock: function (words, offset) {
- // Shortcuts
- var cipher = this._cipher
- var blockSize = cipher.blockSize;
- var iv = this._iv;
- var counter = this._counter;
-
- // Generate keystream
- if (iv) {
- counter = this._counter = iv.slice(0);
-
- // Remove IV for subsequent blocks
- this._iv = undefined;
- }
- var keystream = counter.slice(0);
- cipher.encryptBlock(keystream, 0);
-
- // Increment counter
- counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0
-
- // Encrypt
- for (var i = 0; i < blockSize; i++) {
- words[offset + i] ^= keystream[i];
- }
- }
- });
-
- CTR.Decryptor = Encryptor;
-
- return CTR;
- }());
-
-
- return CryptoJS.mode.CTR;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/mode-ecb.js":
-/*!********************************************!*\
- !*** ./node_modules/crypto-js/mode-ecb.js ***!
- \********************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /**
- * Electronic Codebook block mode.
- */
- CryptoJS.mode.ECB = (function () {
- var ECB = CryptoJS.lib.BlockCipherMode.extend();
-
- ECB.Encryptor = ECB.extend({
- processBlock: function (words, offset) {
- this._cipher.encryptBlock(words, offset);
- }
- });
-
- ECB.Decryptor = ECB.extend({
- processBlock: function (words, offset) {
- this._cipher.decryptBlock(words, offset);
- }
- });
-
- return ECB;
- }());
-
-
- return CryptoJS.mode.ECB;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/mode-ofb.js":
-/*!********************************************!*\
- !*** ./node_modules/crypto-js/mode-ofb.js ***!
- \********************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /**
- * Output Feedback block mode.
- */
- CryptoJS.mode.OFB = (function () {
- var OFB = CryptoJS.lib.BlockCipherMode.extend();
-
- var Encryptor = OFB.Encryptor = OFB.extend({
- processBlock: function (words, offset) {
- // Shortcuts
- var cipher = this._cipher
- var blockSize = cipher.blockSize;
- var iv = this._iv;
- var keystream = this._keystream;
-
- // Generate keystream
- if (iv) {
- keystream = this._keystream = iv.slice(0);
-
- // Remove IV for subsequent blocks
- this._iv = undefined;
- }
- cipher.encryptBlock(keystream, 0);
-
- // Encrypt
- for (var i = 0; i < blockSize; i++) {
- words[offset + i] ^= keystream[i];
- }
- }
- });
-
- OFB.Decryptor = Encryptor;
-
- return OFB;
- }());
-
-
- return CryptoJS.mode.OFB;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/pad-ansix923.js":
-/*!************************************************!*\
- !*** ./node_modules/crypto-js/pad-ansix923.js ***!
- \************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /**
- * ANSI X.923 padding strategy.
- */
- CryptoJS.pad.AnsiX923 = {
- pad: function (data, blockSize) {
- // Shortcuts
- var dataSigBytes = data.sigBytes;
- var blockSizeBytes = blockSize * 4;
-
- // Count padding bytes
- var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
-
- // Compute last byte position
- var lastBytePos = dataSigBytes + nPaddingBytes - 1;
-
- // Pad
- data.clamp();
- data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
- data.sigBytes += nPaddingBytes;
- },
-
- unpad: function (data) {
- // Get number of padding bytes from last byte
- var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
-
- // Remove padding
- data.sigBytes -= nPaddingBytes;
- }
- };
-
-
- return CryptoJS.pad.Ansix923;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/pad-iso10126.js":
-/*!************************************************!*\
- !*** ./node_modules/crypto-js/pad-iso10126.js ***!
- \************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /**
- * ISO 10126 padding strategy.
- */
- CryptoJS.pad.Iso10126 = {
- pad: function (data, blockSize) {
- // Shortcut
- var blockSizeBytes = blockSize * 4;
-
- // Count padding bytes
- var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
-
- // Pad
- data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
- concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
- },
-
- unpad: function (data) {
- // Get number of padding bytes from last byte
- var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
-
- // Remove padding
- data.sigBytes -= nPaddingBytes;
- }
- };
-
-
- return CryptoJS.pad.Iso10126;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/pad-iso97971.js":
-/*!************************************************!*\
- !*** ./node_modules/crypto-js/pad-iso97971.js ***!
- \************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /**
- * ISO/IEC 9797-1 Padding Method 2.
- */
- CryptoJS.pad.Iso97971 = {
- pad: function (data, blockSize) {
- // Add 0x80 byte
- data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
-
- // Zero pad the rest
- CryptoJS.pad.ZeroPadding.pad(data, blockSize);
- },
-
- unpad: function (data) {
- // Remove zero padding
- CryptoJS.pad.ZeroPadding.unpad(data);
-
- // Remove one more byte -- the 0x80 byte
- data.sigBytes--;
- }
- };
-
-
- return CryptoJS.pad.Iso97971;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/pad-nopadding.js":
-/*!*************************************************!*\
- !*** ./node_modules/crypto-js/pad-nopadding.js ***!
- \*************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /**
- * A noop padding strategy.
- */
- CryptoJS.pad.NoPadding = {
- pad: function () {
- },
-
- unpad: function () {
- }
- };
-
-
- return CryptoJS.pad.NoPadding;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/pad-zeropadding.js":
-/*!***************************************************!*\
- !*** ./node_modules/crypto-js/pad-zeropadding.js ***!
- \***************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /**
- * Zero padding strategy.
- */
- CryptoJS.pad.ZeroPadding = {
- pad: function (data, blockSize) {
- // Shortcut
- var blockSizeBytes = blockSize * 4;
-
- // Pad
- data.clamp();
- data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
- },
-
- unpad: function (data) {
- // Shortcut
- var dataWords = data.words;
-
- // Unpad
- var i = data.sigBytes - 1;
- for (var i = data.sigBytes - 1; i >= 0; i--) {
- if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
- data.sigBytes = i + 1;
- break;
- }
- }
- }
- };
-
-
- return CryptoJS.pad.ZeroPadding;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/pbkdf2.js":
-/*!******************************************!*\
- !*** ./node_modules/crypto-js/pbkdf2.js ***!
- \******************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha1 */ "./node_modules/crypto-js/sha1.js"), __webpack_require__(/*! ./hmac */ "./node_modules/crypto-js/hmac.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var Base = C_lib.Base;
- var WordArray = C_lib.WordArray;
- var C_algo = C.algo;
- var SHA1 = C_algo.SHA1;
- var HMAC = C_algo.HMAC;
-
- /**
- * Password-Based Key Derivation Function 2 algorithm.
- */
- var PBKDF2 = C_algo.PBKDF2 = Base.extend({
- /**
- * Configuration options.
- *
- * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
- * @property {Hasher} hasher The hasher to use. Default: SHA1
- * @property {number} iterations The number of iterations to perform. Default: 1
- */
- cfg: Base.extend({
- keySize: 128/32,
- hasher: SHA1,
- iterations: 1
- }),
-
- /**
- * Initializes a newly created key derivation function.
- *
- * @param {Object} cfg (Optional) The configuration options to use for the derivation.
- *
- * @example
- *
- * var kdf = CryptoJS.algo.PBKDF2.create();
- * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
- * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
- */
- init: function (cfg) {
- this.cfg = this.cfg.extend(cfg);
- },
-
- /**
- * Computes the Password-Based Key Derivation Function 2.
- *
- * @param {WordArray|string} password The password.
- * @param {WordArray|string} salt A salt.
- *
- * @return {WordArray} The derived key.
- *
- * @example
- *
- * var key = kdf.compute(password, salt);
- */
- compute: function (password, salt) {
- // Shortcut
- var cfg = this.cfg;
-
- // Init HMAC
- var hmac = HMAC.create(cfg.hasher, password);
-
- // Initial values
- var derivedKey = WordArray.create();
- var blockIndex = WordArray.create([0x00000001]);
-
- // Shortcuts
- var derivedKeyWords = derivedKey.words;
- var blockIndexWords = blockIndex.words;
- var keySize = cfg.keySize;
- var iterations = cfg.iterations;
-
- // Generate key
- while (derivedKeyWords.length < keySize) {
- var block = hmac.update(salt).finalize(blockIndex);
- hmac.reset();
-
- // Shortcuts
- var blockWords = block.words;
- var blockWordsLength = blockWords.length;
-
- // Iterations
- var intermediate = block;
- for (var i = 1; i < iterations; i++) {
- intermediate = hmac.finalize(intermediate);
- hmac.reset();
-
- // Shortcut
- var intermediateWords = intermediate.words;
-
- // XOR intermediate with block
- for (var j = 0; j < blockWordsLength; j++) {
- blockWords[j] ^= intermediateWords[j];
- }
- }
-
- derivedKey.concat(block);
- blockIndexWords[0]++;
- }
- derivedKey.sigBytes = keySize * 4;
-
- return derivedKey;
- }
- });
-
- /**
- * Computes the Password-Based Key Derivation Function 2.
- *
- * @param {WordArray|string} password The password.
- * @param {WordArray|string} salt A salt.
- * @param {Object} cfg (Optional) The configuration options to use for this computation.
- *
- * @return {WordArray} The derived key.
- *
- * @static
- *
- * @example
- *
- * var key = CryptoJS.PBKDF2(password, salt);
- * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
- * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
- */
- C.PBKDF2 = function (password, salt, cfg) {
- return PBKDF2.create(cfg).compute(password, salt);
- };
- }());
-
-
- return CryptoJS.PBKDF2;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/rabbit-legacy.js":
-/*!*************************************************!*\
- !*** ./node_modules/crypto-js/rabbit-legacy.js ***!
- \*************************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var StreamCipher = C_lib.StreamCipher;
- var C_algo = C.algo;
-
- // Reusable objects
- var S = [];
- var C_ = [];
- var G = [];
-
- /**
- * Rabbit stream cipher algorithm.
- *
- * This is a legacy version that neglected to convert the key to little-endian.
- * This error doesn't affect the cipher's security,
- * but it does affect its compatibility with other implementations.
- */
- var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
- _doReset: function () {
- // Shortcuts
- var K = this._key.words;
- var iv = this.cfg.iv;
-
- // Generate initial state values
- var X = this._X = [
- K[0], (K[3] << 16) | (K[2] >>> 16),
- K[1], (K[0] << 16) | (K[3] >>> 16),
- K[2], (K[1] << 16) | (K[0] >>> 16),
- K[3], (K[2] << 16) | (K[1] >>> 16)
- ];
-
- // Generate initial counter values
- var C = this._C = [
- (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
- (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
- (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
- (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
- ];
-
- // Carry bit
- this._b = 0;
-
- // Iterate the system four times
- for (var i = 0; i < 4; i++) {
- nextState.call(this);
- }
-
- // Modify the counters
- for (var i = 0; i < 8; i++) {
- C[i] ^= X[(i + 4) & 7];
- }
-
- // IV setup
- if (iv) {
- // Shortcuts
- var IV = iv.words;
- var IV_0 = IV[0];
- var IV_1 = IV[1];
-
- // Generate four subvectors
- var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
- var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
- var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
- var i3 = (i2 << 16) | (i0 & 0x0000ffff);
-
- // Modify counter values
- C[0] ^= i0;
- C[1] ^= i1;
- C[2] ^= i2;
- C[3] ^= i3;
- C[4] ^= i0;
- C[5] ^= i1;
- C[6] ^= i2;
- C[7] ^= i3;
-
- // Iterate the system four times
- for (var i = 0; i < 4; i++) {
- nextState.call(this);
- }
- }
- },
-
- _doProcessBlock: function (M, offset) {
- // Shortcut
- var X = this._X;
-
- // Iterate the system
- nextState.call(this);
-
- // Generate four keystream words
- S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
- S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
- S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
- S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
-
- for (var i = 0; i < 4; i++) {
- // Swap endian
- S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
- (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
-
- // Encrypt
- M[offset + i] ^= S[i];
- }
- },
-
- blockSize: 128/32,
-
- ivSize: 64/32
- });
-
- function nextState() {
- // Shortcuts
- var X = this._X;
- var C = this._C;
-
- // Save old counter values
- for (var i = 0; i < 8; i++) {
- C_[i] = C[i];
- }
-
- // Calculate new counter values
- C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
- C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
- C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
- C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
- C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
- C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
- C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
- C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
- this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
-
- // Calculate the g-values
- for (var i = 0; i < 8; i++) {
- var gx = X[i] + C[i];
-
- // Construct high and low argument for squaring
- var ga = gx & 0xffff;
- var gb = gx >>> 16;
-
- // Calculate high and low result of squaring
- var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
- var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
-
- // High XOR low
- G[i] = gh ^ gl;
- }
-
- // Calculate new state values
- X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
- X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
- X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
- X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
- X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
- X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
- X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
- X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
- }
-
- /**
- * Shortcut functions to the cipher's object interface.
- *
- * @example
- *
- * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);
- * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);
- */
- C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
- }());
-
-
- return CryptoJS.RabbitLegacy;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/rabbit.js":
-/*!******************************************!*\
- !*** ./node_modules/crypto-js/rabbit.js ***!
- \******************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var StreamCipher = C_lib.StreamCipher;
- var C_algo = C.algo;
-
- // Reusable objects
- var S = [];
- var C_ = [];
- var G = [];
-
- /**
- * Rabbit stream cipher algorithm
- */
- var Rabbit = C_algo.Rabbit = StreamCipher.extend({
- _doReset: function () {
- // Shortcuts
- var K = this._key.words;
- var iv = this.cfg.iv;
-
- // Swap endian
- for (var i = 0; i < 4; i++) {
- K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) |
- (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00);
- }
-
- // Generate initial state values
- var X = this._X = [
- K[0], (K[3] << 16) | (K[2] >>> 16),
- K[1], (K[0] << 16) | (K[3] >>> 16),
- K[2], (K[1] << 16) | (K[0] >>> 16),
- K[3], (K[2] << 16) | (K[1] >>> 16)
- ];
-
- // Generate initial counter values
- var C = this._C = [
- (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
- (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
- (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
- (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
- ];
-
- // Carry bit
- this._b = 0;
-
- // Iterate the system four times
- for (var i = 0; i < 4; i++) {
- nextState.call(this);
- }
-
- // Modify the counters
- for (var i = 0; i < 8; i++) {
- C[i] ^= X[(i + 4) & 7];
- }
-
- // IV setup
- if (iv) {
- // Shortcuts
- var IV = iv.words;
- var IV_0 = IV[0];
- var IV_1 = IV[1];
-
- // Generate four subvectors
- var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
- var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
- var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
- var i3 = (i2 << 16) | (i0 & 0x0000ffff);
-
- // Modify counter values
- C[0] ^= i0;
- C[1] ^= i1;
- C[2] ^= i2;
- C[3] ^= i3;
- C[4] ^= i0;
- C[5] ^= i1;
- C[6] ^= i2;
- C[7] ^= i3;
-
- // Iterate the system four times
- for (var i = 0; i < 4; i++) {
- nextState.call(this);
- }
- }
- },
-
- _doProcessBlock: function (M, offset) {
- // Shortcut
- var X = this._X;
-
- // Iterate the system
- nextState.call(this);
-
- // Generate four keystream words
- S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
- S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
- S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
- S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
-
- for (var i = 0; i < 4; i++) {
- // Swap endian
- S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
- (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
-
- // Encrypt
- M[offset + i] ^= S[i];
- }
- },
-
- blockSize: 128/32,
-
- ivSize: 64/32
- });
-
- function nextState() {
- // Shortcuts
- var X = this._X;
- var C = this._C;
-
- // Save old counter values
- for (var i = 0; i < 8; i++) {
- C_[i] = C[i];
- }
-
- // Calculate new counter values
- C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
- C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
- C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
- C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
- C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
- C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
- C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
- C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
- this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
-
- // Calculate the g-values
- for (var i = 0; i < 8; i++) {
- var gx = X[i] + C[i];
-
- // Construct high and low argument for squaring
- var ga = gx & 0xffff;
- var gb = gx >>> 16;
-
- // Calculate high and low result of squaring
- var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
- var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
-
- // High XOR low
- G[i] = gh ^ gl;
- }
-
- // Calculate new state values
- X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
- X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
- X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
- X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
- X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
- X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
- X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
- X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
- }
-
- /**
- * Shortcut functions to the cipher's object interface.
- *
- * @example
- *
- * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
- * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
- */
- C.Rabbit = StreamCipher._createHelper(Rabbit);
- }());
-
-
- return CryptoJS.Rabbit;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/rc4.js":
-/*!***************************************!*\
- !*** ./node_modules/crypto-js/rc4.js ***!
- \***************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var StreamCipher = C_lib.StreamCipher;
- var C_algo = C.algo;
-
- /**
- * RC4 stream cipher algorithm.
- */
- var RC4 = C_algo.RC4 = StreamCipher.extend({
- _doReset: function () {
- // Shortcuts
- var key = this._key;
- var keyWords = key.words;
- var keySigBytes = key.sigBytes;
-
- // Init sbox
- var S = this._S = [];
- for (var i = 0; i < 256; i++) {
- S[i] = i;
- }
-
- // Key setup
- for (var i = 0, j = 0; i < 256; i++) {
- var keyByteIndex = i % keySigBytes;
- var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
-
- j = (j + S[i] + keyByte) % 256;
-
- // Swap
- var t = S[i];
- S[i] = S[j];
- S[j] = t;
- }
-
- // Counters
- this._i = this._j = 0;
- },
-
- _doProcessBlock: function (M, offset) {
- M[offset] ^= generateKeystreamWord.call(this);
- },
-
- keySize: 256/32,
-
- ivSize: 0
- });
-
- function generateKeystreamWord() {
- // Shortcuts
- var S = this._S;
- var i = this._i;
- var j = this._j;
-
- // Generate keystream word
- var keystreamWord = 0;
- for (var n = 0; n < 4; n++) {
- i = (i + 1) % 256;
- j = (j + S[i]) % 256;
-
- // Swap
- var t = S[i];
- S[i] = S[j];
- S[j] = t;
-
- keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
- }
-
- // Update counters
- this._i = i;
- this._j = j;
-
- return keystreamWord;
- }
-
- /**
- * Shortcut functions to the cipher's object interface.
- *
- * @example
- *
- * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
- * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
- */
- C.RC4 = StreamCipher._createHelper(RC4);
-
- /**
- * Modified RC4 stream cipher algorithm.
- */
- var RC4Drop = C_algo.RC4Drop = RC4.extend({
- /**
- * Configuration options.
- *
- * @property {number} drop The number of keystream words to drop. Default 192
- */
- cfg: RC4.cfg.extend({
- drop: 192
- }),
-
- _doReset: function () {
- RC4._doReset.call(this);
-
- // Drop
- for (var i = this.cfg.drop; i > 0; i--) {
- generateKeystreamWord.call(this);
- }
- }
- });
-
- /**
- * Shortcut functions to the cipher's object interface.
- *
- * @example
- *
- * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
- * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
- */
- C.RC4Drop = StreamCipher._createHelper(RC4Drop);
- }());
-
-
- return CryptoJS.RC4;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/ripemd160.js":
-/*!*********************************************!*\
- !*** ./node_modules/crypto-js/ripemd160.js ***!
- \*********************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- /** @preserve
- (c) 2012 by Cédric Mesnil. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
- (function (Math) {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var Hasher = C_lib.Hasher;
- var C_algo = C.algo;
-
- // Constants table
- var _zl = WordArray.create([
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
- 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
- 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
- 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);
- var _zr = WordArray.create([
- 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
- 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
- 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
- 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
- 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);
- var _sl = WordArray.create([
- 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
- 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
- 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
- 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
- 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]);
- var _sr = WordArray.create([
- 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
- 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
- 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
- 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
- 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]);
-
- var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);
- var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);
-
- /**
- * RIPEMD160 hash algorithm.
- */
- var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
- _doReset: function () {
- this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
- },
-
- _doProcessBlock: function (M, offset) {
-
- // Swap endian
- for (var i = 0; i < 16; i++) {
- // Shortcuts
- var offset_i = offset + i;
- var M_offset_i = M[offset_i];
-
- // Swap
- M[offset_i] = (
- (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
- (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
- );
- }
- // Shortcut
- var H = this._hash.words;
- var hl = _hl.words;
- var hr = _hr.words;
- var zl = _zl.words;
- var zr = _zr.words;
- var sl = _sl.words;
- var sr = _sr.words;
-
- // Working variables
- var al, bl, cl, dl, el;
- var ar, br, cr, dr, er;
-
- ar = al = H[0];
- br = bl = H[1];
- cr = cl = H[2];
- dr = dl = H[3];
- er = el = H[4];
- // Computation
- var t;
- for (var i = 0; i < 80; i += 1) {
- t = (al + M[offset+zl[i]])|0;
- if (i<16){
- t += f1(bl,cl,dl) + hl[0];
- } else if (i<32) {
- t += f2(bl,cl,dl) + hl[1];
- } else if (i<48) {
- t += f3(bl,cl,dl) + hl[2];
- } else if (i<64) {
- t += f4(bl,cl,dl) + hl[3];
- } else {// if (i<80) {
- t += f5(bl,cl,dl) + hl[4];
- }
- t = t|0;
- t = rotl(t,sl[i]);
- t = (t+el)|0;
- al = el;
- el = dl;
- dl = rotl(cl, 10);
- cl = bl;
- bl = t;
-
- t = (ar + M[offset+zr[i]])|0;
- if (i<16){
- t += f5(br,cr,dr) + hr[0];
- } else if (i<32) {
- t += f4(br,cr,dr) + hr[1];
- } else if (i<48) {
- t += f3(br,cr,dr) + hr[2];
- } else if (i<64) {
- t += f2(br,cr,dr) + hr[3];
- } else {// if (i<80) {
- t += f1(br,cr,dr) + hr[4];
- }
- t = t|0;
- t = rotl(t,sr[i]) ;
- t = (t+er)|0;
- ar = er;
- er = dr;
- dr = rotl(cr, 10);
- cr = br;
- br = t;
- }
- // Intermediate hash value
- t = (H[1] + cl + dr)|0;
- H[1] = (H[2] + dl + er)|0;
- H[2] = (H[3] + el + ar)|0;
- H[3] = (H[4] + al + br)|0;
- H[4] = (H[0] + bl + cr)|0;
- H[0] = t;
- },
-
- _doFinalize: function () {
- // Shortcuts
- var data = this._data;
- var dataWords = data.words;
-
- var nBitsTotal = this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
-
- // Add padding
- dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
- dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
- (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
- (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
- );
- data.sigBytes = (dataWords.length + 1) * 4;
-
- // Hash final blocks
- this._process();
-
- // Shortcuts
- var hash = this._hash;
- var H = hash.words;
-
- // Swap endian
- for (var i = 0; i < 5; i++) {
- // Shortcut
- var H_i = H[i];
-
- // Swap
- H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
- (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
- }
-
- // Return final computed hash
- return hash;
- },
-
- clone: function () {
- var clone = Hasher.clone.call(this);
- clone._hash = this._hash.clone();
-
- return clone;
- }
- });
-
-
- function f1(x, y, z) {
- return ((x) ^ (y) ^ (z));
-
- }
-
- function f2(x, y, z) {
- return (((x)&(y)) | ((~x)&(z)));
- }
-
- function f3(x, y, z) {
- return (((x) | (~(y))) ^ (z));
- }
-
- function f4(x, y, z) {
- return (((x) & (z)) | ((y)&(~(z))));
- }
-
- function f5(x, y, z) {
- return ((x) ^ ((y) |(~(z))));
-
- }
-
- function rotl(x,n) {
- return (x<>>(32-n));
- }
-
-
- /**
- * Shortcut function to the hasher's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- *
- * @return {WordArray} The hash.
- *
- * @static
- *
- * @example
- *
- * var hash = CryptoJS.RIPEMD160('message');
- * var hash = CryptoJS.RIPEMD160(wordArray);
- */
- C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
-
- /**
- * Shortcut function to the HMAC's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- * @param {WordArray|string} key The secret key.
- *
- * @return {WordArray} The HMAC.
- *
- * @static
- *
- * @example
- *
- * var hmac = CryptoJS.HmacRIPEMD160(message, key);
- */
- C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
- }(Math));
-
-
- return CryptoJS.RIPEMD160;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/sha1.js":
-/*!****************************************!*\
- !*** ./node_modules/crypto-js/sha1.js ***!
- \****************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var Hasher = C_lib.Hasher;
- var C_algo = C.algo;
-
- // Reusable object
- var W = [];
-
- /**
- * SHA-1 hash algorithm.
- */
- var SHA1 = C_algo.SHA1 = Hasher.extend({
- _doReset: function () {
- this._hash = new WordArray.init([
- 0x67452301, 0xefcdab89,
- 0x98badcfe, 0x10325476,
- 0xc3d2e1f0
- ]);
- },
-
- _doProcessBlock: function (M, offset) {
- // Shortcut
- var H = this._hash.words;
-
- // Working variables
- var a = H[0];
- var b = H[1];
- var c = H[2];
- var d = H[3];
- var e = H[4];
-
- // Computation
- for (var i = 0; i < 80; i++) {
- if (i < 16) {
- W[i] = M[offset + i] | 0;
- } else {
- var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
- W[i] = (n << 1) | (n >>> 31);
- }
-
- var t = ((a << 5) | (a >>> 27)) + e + W[i];
- if (i < 20) {
- t += ((b & c) | (~b & d)) + 0x5a827999;
- } else if (i < 40) {
- t += (b ^ c ^ d) + 0x6ed9eba1;
- } else if (i < 60) {
- t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
- } else /* if (i < 80) */ {
- t += (b ^ c ^ d) - 0x359d3e2a;
- }
-
- e = d;
- d = c;
- c = (b << 30) | (b >>> 2);
- b = a;
- a = t;
- }
-
- // Intermediate hash value
- H[0] = (H[0] + a) | 0;
- H[1] = (H[1] + b) | 0;
- H[2] = (H[2] + c) | 0;
- H[3] = (H[3] + d) | 0;
- H[4] = (H[4] + e) | 0;
- },
-
- _doFinalize: function () {
- // Shortcuts
- var data = this._data;
- var dataWords = data.words;
-
- var nBitsTotal = this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
-
- // Add padding
- dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
- dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
- dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
- data.sigBytes = dataWords.length * 4;
-
- // Hash final blocks
- this._process();
-
- // Return final computed hash
- return this._hash;
- },
-
- clone: function () {
- var clone = Hasher.clone.call(this);
- clone._hash = this._hash.clone();
-
- return clone;
- }
- });
-
- /**
- * Shortcut function to the hasher's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- *
- * @return {WordArray} The hash.
- *
- * @static
- *
- * @example
- *
- * var hash = CryptoJS.SHA1('message');
- * var hash = CryptoJS.SHA1(wordArray);
- */
- C.SHA1 = Hasher._createHelper(SHA1);
-
- /**
- * Shortcut function to the HMAC's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- * @param {WordArray|string} key The secret key.
- *
- * @return {WordArray} The HMAC.
- *
- * @static
- *
- * @example
- *
- * var hmac = CryptoJS.HmacSHA1(message, key);
- */
- C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
- }());
-
-
- return CryptoJS.SHA1;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/sha224.js":
-/*!******************************************!*\
- !*** ./node_modules/crypto-js/sha224.js ***!
- \******************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./sha256 */ "./node_modules/crypto-js/sha256.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var C_algo = C.algo;
- var SHA256 = C_algo.SHA256;
-
- /**
- * SHA-224 hash algorithm.
- */
- var SHA224 = C_algo.SHA224 = SHA256.extend({
- _doReset: function () {
- this._hash = new WordArray.init([
- 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
- 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
- ]);
- },
-
- _doFinalize: function () {
- var hash = SHA256._doFinalize.call(this);
-
- hash.sigBytes -= 4;
-
- return hash;
- }
- });
-
- /**
- * Shortcut function to the hasher's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- *
- * @return {WordArray} The hash.
- *
- * @static
- *
- * @example
- *
- * var hash = CryptoJS.SHA224('message');
- * var hash = CryptoJS.SHA224(wordArray);
- */
- C.SHA224 = SHA256._createHelper(SHA224);
-
- /**
- * Shortcut function to the HMAC's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- * @param {WordArray|string} key The secret key.
- *
- * @return {WordArray} The HMAC.
- *
- * @static
- *
- * @example
- *
- * var hmac = CryptoJS.HmacSHA224(message, key);
- */
- C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
- }());
-
-
- return CryptoJS.SHA224;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/sha256.js":
-/*!******************************************!*\
- !*** ./node_modules/crypto-js/sha256.js ***!
- \******************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function (Math) {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var Hasher = C_lib.Hasher;
- var C_algo = C.algo;
-
- // Initialization and round constants tables
- var H = [];
- var K = [];
-
- // Compute constants
- (function () {
- function isPrime(n) {
- var sqrtN = Math.sqrt(n);
- for (var factor = 2; factor <= sqrtN; factor++) {
- if (!(n % factor)) {
- return false;
- }
- }
-
- return true;
- }
-
- function getFractionalBits(n) {
- return ((n - (n | 0)) * 0x100000000) | 0;
- }
-
- var n = 2;
- var nPrime = 0;
- while (nPrime < 64) {
- if (isPrime(n)) {
- if (nPrime < 8) {
- H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
- }
- K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
-
- nPrime++;
- }
-
- n++;
- }
- }());
-
- // Reusable object
- var W = [];
-
- /**
- * SHA-256 hash algorithm.
- */
- var SHA256 = C_algo.SHA256 = Hasher.extend({
- _doReset: function () {
- this._hash = new WordArray.init(H.slice(0));
- },
-
- _doProcessBlock: function (M, offset) {
- // Shortcut
- var H = this._hash.words;
-
- // Working variables
- var a = H[0];
- var b = H[1];
- var c = H[2];
- var d = H[3];
- var e = H[4];
- var f = H[5];
- var g = H[6];
- var h = H[7];
-
- // Computation
- for (var i = 0; i < 64; i++) {
- if (i < 16) {
- W[i] = M[offset + i] | 0;
- } else {
- var gamma0x = W[i - 15];
- var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^
- ((gamma0x << 14) | (gamma0x >>> 18)) ^
- (gamma0x >>> 3);
-
- var gamma1x = W[i - 2];
- var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^
- ((gamma1x << 13) | (gamma1x >>> 19)) ^
- (gamma1x >>> 10);
-
- W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
- }
-
- var ch = (e & f) ^ (~e & g);
- var maj = (a & b) ^ (a & c) ^ (b & c);
-
- var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
- var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
-
- var t1 = h + sigma1 + ch + K[i] + W[i];
- var t2 = sigma0 + maj;
-
- h = g;
- g = f;
- f = e;
- e = (d + t1) | 0;
- d = c;
- c = b;
- b = a;
- a = (t1 + t2) | 0;
- }
-
- // Intermediate hash value
- H[0] = (H[0] + a) | 0;
- H[1] = (H[1] + b) | 0;
- H[2] = (H[2] + c) | 0;
- H[3] = (H[3] + d) | 0;
- H[4] = (H[4] + e) | 0;
- H[5] = (H[5] + f) | 0;
- H[6] = (H[6] + g) | 0;
- H[7] = (H[7] + h) | 0;
- },
-
- _doFinalize: function () {
- // Shortcuts
- var data = this._data;
- var dataWords = data.words;
-
- var nBitsTotal = this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
-
- // Add padding
- dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
- dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
- dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
- data.sigBytes = dataWords.length * 4;
-
- // Hash final blocks
- this._process();
-
- // Return final computed hash
- return this._hash;
- },
-
- clone: function () {
- var clone = Hasher.clone.call(this);
- clone._hash = this._hash.clone();
-
- return clone;
- }
- });
-
- /**
- * Shortcut function to the hasher's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- *
- * @return {WordArray} The hash.
- *
- * @static
- *
- * @example
- *
- * var hash = CryptoJS.SHA256('message');
- * var hash = CryptoJS.SHA256(wordArray);
- */
- C.SHA256 = Hasher._createHelper(SHA256);
-
- /**
- * Shortcut function to the HMAC's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- * @param {WordArray|string} key The secret key.
- *
- * @return {WordArray} The HMAC.
- *
- * @static
- *
- * @example
- *
- * var hmac = CryptoJS.HmacSHA256(message, key);
- */
- C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
- }(Math));
-
-
- return CryptoJS.SHA256;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/sha3.js":
-/*!****************************************!*\
- !*** ./node_modules/crypto-js/sha3.js ***!
- \****************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function (Math) {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var Hasher = C_lib.Hasher;
- var C_x64 = C.x64;
- var X64Word = C_x64.Word;
- var C_algo = C.algo;
-
- // Constants tables
- var RHO_OFFSETS = [];
- var PI_INDEXES = [];
- var ROUND_CONSTANTS = [];
-
- // Compute Constants
- (function () {
- // Compute rho offset constants
- var x = 1, y = 0;
- for (var t = 0; t < 24; t++) {
- RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;
-
- var newX = y % 5;
- var newY = (2 * x + 3 * y) % 5;
- x = newX;
- y = newY;
- }
-
- // Compute pi index constants
- for (var x = 0; x < 5; x++) {
- for (var y = 0; y < 5; y++) {
- PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;
- }
- }
-
- // Compute round constants
- var LFSR = 0x01;
- for (var i = 0; i < 24; i++) {
- var roundConstantMsw = 0;
- var roundConstantLsw = 0;
-
- for (var j = 0; j < 7; j++) {
- if (LFSR & 0x01) {
- var bitPosition = (1 << j) - 1;
- if (bitPosition < 32) {
- roundConstantLsw ^= 1 << bitPosition;
- } else /* if (bitPosition >= 32) */ {
- roundConstantMsw ^= 1 << (bitPosition - 32);
- }
- }
-
- // Compute next LFSR
- if (LFSR & 0x80) {
- // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1
- LFSR = (LFSR << 1) ^ 0x71;
- } else {
- LFSR <<= 1;
- }
- }
-
- ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
- }
- }());
-
- // Reusable objects for temporary values
- var T = [];
- (function () {
- for (var i = 0; i < 25; i++) {
- T[i] = X64Word.create();
- }
- }());
-
- /**
- * SHA-3 hash algorithm.
- */
- var SHA3 = C_algo.SHA3 = Hasher.extend({
- /**
- * Configuration options.
- *
- * @property {number} outputLength
- * The desired number of bits in the output hash.
- * Only values permitted are: 224, 256, 384, 512.
- * Default: 512
- */
- cfg: Hasher.cfg.extend({
- outputLength: 512
- }),
-
- _doReset: function () {
- var state = this._state = []
- for (var i = 0; i < 25; i++) {
- state[i] = new X64Word.init();
- }
-
- this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
- },
-
- _doProcessBlock: function (M, offset) {
- // Shortcuts
- var state = this._state;
- var nBlockSizeLanes = this.blockSize / 2;
-
- // Absorb
- for (var i = 0; i < nBlockSizeLanes; i++) {
- // Shortcuts
- var M2i = M[offset + 2 * i];
- var M2i1 = M[offset + 2 * i + 1];
-
- // Swap endian
- M2i = (
- (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) |
- (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00)
- );
- M2i1 = (
- (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) |
- (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00)
- );
-
- // Absorb message into state
- var lane = state[i];
- lane.high ^= M2i1;
- lane.low ^= M2i;
- }
-
- // Rounds
- for (var round = 0; round < 24; round++) {
- // Theta
- for (var x = 0; x < 5; x++) {
- // Mix column lanes
- var tMsw = 0, tLsw = 0;
- for (var y = 0; y < 5; y++) {
- var lane = state[x + 5 * y];
- tMsw ^= lane.high;
- tLsw ^= lane.low;
- }
-
- // Temporary values
- var Tx = T[x];
- Tx.high = tMsw;
- Tx.low = tLsw;
- }
- for (var x = 0; x < 5; x++) {
- // Shortcuts
- var Tx4 = T[(x + 4) % 5];
- var Tx1 = T[(x + 1) % 5];
- var Tx1Msw = Tx1.high;
- var Tx1Lsw = Tx1.low;
-
- // Mix surrounding columns
- var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));
- var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));
- for (var y = 0; y < 5; y++) {
- var lane = state[x + 5 * y];
- lane.high ^= tMsw;
- lane.low ^= tLsw;
- }
- }
-
- // Rho Pi
- for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
- var tMsw;
- var tLsw;
-
- // Shortcuts
- var lane = state[laneIndex];
- var laneMsw = lane.high;
- var laneLsw = lane.low;
- var rhoOffset = RHO_OFFSETS[laneIndex];
-
- // Rotate lanes
- if (rhoOffset < 32) {
- tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));
- tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));
- } else /* if (rhoOffset >= 32) */ {
- tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));
- tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));
- }
-
- // Transpose lanes
- var TPiLane = T[PI_INDEXES[laneIndex]];
- TPiLane.high = tMsw;
- TPiLane.low = tLsw;
- }
-
- // Rho pi at x = y = 0
- var T0 = T[0];
- var state0 = state[0];
- T0.high = state0.high;
- T0.low = state0.low;
-
- // Chi
- for (var x = 0; x < 5; x++) {
- for (var y = 0; y < 5; y++) {
- // Shortcuts
- var laneIndex = x + 5 * y;
- var lane = state[laneIndex];
- var TLane = T[laneIndex];
- var Tx1Lane = T[((x + 1) % 5) + 5 * y];
- var Tx2Lane = T[((x + 2) % 5) + 5 * y];
-
- // Mix rows
- lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);
- lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);
- }
- }
-
- // Iota
- var lane = state[0];
- var roundConstant = ROUND_CONSTANTS[round];
- lane.high ^= roundConstant.high;
- lane.low ^= roundConstant.low;
- }
- },
-
- _doFinalize: function () {
- // Shortcuts
- var data = this._data;
- var dataWords = data.words;
- var nBitsTotal = this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
- var blockSizeBits = this.blockSize * 32;
-
- // Add padding
- dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);
- dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;
- data.sigBytes = dataWords.length * 4;
-
- // Hash final blocks
- this._process();
-
- // Shortcuts
- var state = this._state;
- var outputLengthBytes = this.cfg.outputLength / 8;
- var outputLengthLanes = outputLengthBytes / 8;
-
- // Squeeze
- var hashWords = [];
- for (var i = 0; i < outputLengthLanes; i++) {
- // Shortcuts
- var lane = state[i];
- var laneMsw = lane.high;
- var laneLsw = lane.low;
-
- // Swap endian
- laneMsw = (
- (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) |
- (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00)
- );
- laneLsw = (
- (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) |
- (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00)
- );
-
- // Squeeze state to retrieve hash
- hashWords.push(laneLsw);
- hashWords.push(laneMsw);
- }
-
- // Return final computed hash
- return new WordArray.init(hashWords, outputLengthBytes);
- },
-
- clone: function () {
- var clone = Hasher.clone.call(this);
-
- var state = clone._state = this._state.slice(0);
- for (var i = 0; i < 25; i++) {
- state[i] = state[i].clone();
- }
-
- return clone;
- }
- });
-
- /**
- * Shortcut function to the hasher's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- *
- * @return {WordArray} The hash.
- *
- * @static
- *
- * @example
- *
- * var hash = CryptoJS.SHA3('message');
- * var hash = CryptoJS.SHA3(wordArray);
- */
- C.SHA3 = Hasher._createHelper(SHA3);
-
- /**
- * Shortcut function to the HMAC's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- * @param {WordArray|string} key The secret key.
- *
- * @return {WordArray} The HMAC.
- *
- * @static
- *
- * @example
- *
- * var hmac = CryptoJS.HmacSHA3(message, key);
- */
- C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
- }(Math));
-
-
- return CryptoJS.SHA3;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/sha384.js":
-/*!******************************************!*\
- !*** ./node_modules/crypto-js/sha384.js ***!
- \******************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"), __webpack_require__(/*! ./sha512 */ "./node_modules/crypto-js/sha512.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_x64 = C.x64;
- var X64Word = C_x64.Word;
- var X64WordArray = C_x64.WordArray;
- var C_algo = C.algo;
- var SHA512 = C_algo.SHA512;
-
- /**
- * SHA-384 hash algorithm.
- */
- var SHA384 = C_algo.SHA384 = SHA512.extend({
- _doReset: function () {
- this._hash = new X64WordArray.init([
- new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
- new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
- new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
- new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)
- ]);
- },
-
- _doFinalize: function () {
- var hash = SHA512._doFinalize.call(this);
-
- hash.sigBytes -= 16;
-
- return hash;
- }
- });
-
- /**
- * Shortcut function to the hasher's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- *
- * @return {WordArray} The hash.
- *
- * @static
- *
- * @example
- *
- * var hash = CryptoJS.SHA384('message');
- * var hash = CryptoJS.SHA384(wordArray);
- */
- C.SHA384 = SHA512._createHelper(SHA384);
-
- /**
- * Shortcut function to the HMAC's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- * @param {WordArray|string} key The secret key.
- *
- * @return {WordArray} The HMAC.
- *
- * @static
- *
- * @example
- *
- * var hmac = CryptoJS.HmacSHA384(message, key);
- */
- C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
- }());
-
-
- return CryptoJS.SHA384;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/sha512.js":
-/*!******************************************!*\
- !*** ./node_modules/crypto-js/sha512.js ***!
- \******************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./x64-core */ "./node_modules/crypto-js/x64-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var Hasher = C_lib.Hasher;
- var C_x64 = C.x64;
- var X64Word = C_x64.Word;
- var X64WordArray = C_x64.WordArray;
- var C_algo = C.algo;
-
- function X64Word_create() {
- return X64Word.create.apply(X64Word, arguments);
- }
-
- // Constants
- var K = [
- X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),
- X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),
- X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),
- X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),
- X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),
- X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),
- X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),
- X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),
- X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),
- X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),
- X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),
- X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),
- X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),
- X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),
- X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),
- X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),
- X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),
- X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),
- X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),
- X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),
- X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),
- X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),
- X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),
- X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),
- X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),
- X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),
- X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),
- X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),
- X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),
- X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),
- X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),
- X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),
- X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),
- X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),
- X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),
- X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),
- X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),
- X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),
- X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),
- X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)
- ];
-
- // Reusable objects
- var W = [];
- (function () {
- for (var i = 0; i < 80; i++) {
- W[i] = X64Word_create();
- }
- }());
-
- /**
- * SHA-512 hash algorithm.
- */
- var SHA512 = C_algo.SHA512 = Hasher.extend({
- _doReset: function () {
- this._hash = new X64WordArray.init([
- new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b),
- new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1),
- new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f),
- new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)
- ]);
- },
-
- _doProcessBlock: function (M, offset) {
- // Shortcuts
- var H = this._hash.words;
-
- var H0 = H[0];
- var H1 = H[1];
- var H2 = H[2];
- var H3 = H[3];
- var H4 = H[4];
- var H5 = H[5];
- var H6 = H[6];
- var H7 = H[7];
-
- var H0h = H0.high;
- var H0l = H0.low;
- var H1h = H1.high;
- var H1l = H1.low;
- var H2h = H2.high;
- var H2l = H2.low;
- var H3h = H3.high;
- var H3l = H3.low;
- var H4h = H4.high;
- var H4l = H4.low;
- var H5h = H5.high;
- var H5l = H5.low;
- var H6h = H6.high;
- var H6l = H6.low;
- var H7h = H7.high;
- var H7l = H7.low;
-
- // Working variables
- var ah = H0h;
- var al = H0l;
- var bh = H1h;
- var bl = H1l;
- var ch = H2h;
- var cl = H2l;
- var dh = H3h;
- var dl = H3l;
- var eh = H4h;
- var el = H4l;
- var fh = H5h;
- var fl = H5l;
- var gh = H6h;
- var gl = H6l;
- var hh = H7h;
- var hl = H7l;
-
- // Rounds
- for (var i = 0; i < 80; i++) {
- var Wil;
- var Wih;
-
- // Shortcut
- var Wi = W[i];
-
- // Extend message
- if (i < 16) {
- Wih = Wi.high = M[offset + i * 2] | 0;
- Wil = Wi.low = M[offset + i * 2 + 1] | 0;
- } else {
- // Gamma0
- var gamma0x = W[i - 15];
- var gamma0xh = gamma0x.high;
- var gamma0xl = gamma0x.low;
- var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);
- var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));
-
- // Gamma1
- var gamma1x = W[i - 2];
- var gamma1xh = gamma1x.high;
- var gamma1xl = gamma1x.low;
- var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);
- var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));
-
- // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
- var Wi7 = W[i - 7];
- var Wi7h = Wi7.high;
- var Wi7l = Wi7.low;
-
- var Wi16 = W[i - 16];
- var Wi16h = Wi16.high;
- var Wi16l = Wi16.low;
-
- Wil = gamma0l + Wi7l;
- Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);
- Wil = Wil + gamma1l;
- Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);
- Wil = Wil + Wi16l;
- Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);
-
- Wi.high = Wih;
- Wi.low = Wil;
- }
-
- var chh = (eh & fh) ^ (~eh & gh);
- var chl = (el & fl) ^ (~el & gl);
- var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
- var majl = (al & bl) ^ (al & cl) ^ (bl & cl);
-
- var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
- var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
- var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));
- var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));
-
- // t1 = h + sigma1 + ch + K[i] + W[i]
- var Ki = K[i];
- var Kih = Ki.high;
- var Kil = Ki.low;
-
- var t1l = hl + sigma1l;
- var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
- var t1l = t1l + chl;
- var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
- var t1l = t1l + Kil;
- var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);
- var t1l = t1l + Wil;
- var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);
-
- // t2 = sigma0 + maj
- var t2l = sigma0l + majl;
- var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
-
- // Update working variables
- hh = gh;
- hl = gl;
- gh = fh;
- gl = fl;
- fh = eh;
- fl = el;
- el = (dl + t1l) | 0;
- eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
- dh = ch;
- dl = cl;
- ch = bh;
- cl = bl;
- bh = ah;
- bl = al;
- al = (t1l + t2l) | 0;
- ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
- }
-
- // Intermediate hash value
- H0l = H0.low = (H0l + al);
- H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));
- H1l = H1.low = (H1l + bl);
- H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));
- H2l = H2.low = (H2l + cl);
- H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));
- H3l = H3.low = (H3l + dl);
- H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));
- H4l = H4.low = (H4l + el);
- H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));
- H5l = H5.low = (H5l + fl);
- H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));
- H6l = H6.low = (H6l + gl);
- H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));
- H7l = H7.low = (H7l + hl);
- H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));
- },
-
- _doFinalize: function () {
- // Shortcuts
- var data = this._data;
- var dataWords = data.words;
-
- var nBitsTotal = this._nDataBytes * 8;
- var nBitsLeft = data.sigBytes * 8;
-
- // Add padding
- dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
- dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);
- dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;
- data.sigBytes = dataWords.length * 4;
-
- // Hash final blocks
- this._process();
-
- // Convert hash to 32-bit word array before returning
- var hash = this._hash.toX32();
-
- // Return final computed hash
- return hash;
- },
-
- clone: function () {
- var clone = Hasher.clone.call(this);
- clone._hash = this._hash.clone();
-
- return clone;
- },
-
- blockSize: 1024/32
- });
-
- /**
- * Shortcut function to the hasher's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- *
- * @return {WordArray} The hash.
- *
- * @static
- *
- * @example
- *
- * var hash = CryptoJS.SHA512('message');
- * var hash = CryptoJS.SHA512(wordArray);
- */
- C.SHA512 = Hasher._createHelper(SHA512);
-
- /**
- * Shortcut function to the HMAC's object interface.
- *
- * @param {WordArray|string} message The message to hash.
- * @param {WordArray|string} key The secret key.
- *
- * @return {WordArray} The HMAC.
- *
- * @static
- *
- * @example
- *
- * var hmac = CryptoJS.HmacSHA512(message, key);
- */
- C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
- }());
-
-
- return CryptoJS.SHA512;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/tripledes.js":
-/*!*********************************************!*\
- !*** ./node_modules/crypto-js/tripledes.js ***!
- \*********************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory, undef) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"), __webpack_require__(/*! ./enc-base64 */ "./node_modules/crypto-js/enc-base64.js"), __webpack_require__(/*! ./md5 */ "./node_modules/crypto-js/md5.js"), __webpack_require__(/*! ./evpkdf */ "./node_modules/crypto-js/evpkdf.js"), __webpack_require__(/*! ./cipher-core */ "./node_modules/crypto-js/cipher-core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function () {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var BlockCipher = C_lib.BlockCipher;
- var C_algo = C.algo;
-
- // Permuted Choice 1 constants
- var PC1 = [
- 57, 49, 41, 33, 25, 17, 9, 1,
- 58, 50, 42, 34, 26, 18, 10, 2,
- 59, 51, 43, 35, 27, 19, 11, 3,
- 60, 52, 44, 36, 63, 55, 47, 39,
- 31, 23, 15, 7, 62, 54, 46, 38,
- 30, 22, 14, 6, 61, 53, 45, 37,
- 29, 21, 13, 5, 28, 20, 12, 4
- ];
-
- // Permuted Choice 2 constants
- var PC2 = [
- 14, 17, 11, 24, 1, 5,
- 3, 28, 15, 6, 21, 10,
- 23, 19, 12, 4, 26, 8,
- 16, 7, 27, 20, 13, 2,
- 41, 52, 31, 37, 47, 55,
- 30, 40, 51, 45, 33, 48,
- 44, 49, 39, 56, 34, 53,
- 46, 42, 50, 36, 29, 32
- ];
-
- // Cumulative bit shift constants
- var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
-
- // SBOXes and round permutation constants
- var SBOX_P = [
- {
- 0x0: 0x808200,
- 0x10000000: 0x8000,
- 0x20000000: 0x808002,
- 0x30000000: 0x2,
- 0x40000000: 0x200,
- 0x50000000: 0x808202,
- 0x60000000: 0x800202,
- 0x70000000: 0x800000,
- 0x80000000: 0x202,
- 0x90000000: 0x800200,
- 0xa0000000: 0x8200,
- 0xb0000000: 0x808000,
- 0xc0000000: 0x8002,
- 0xd0000000: 0x800002,
- 0xe0000000: 0x0,
- 0xf0000000: 0x8202,
- 0x8000000: 0x0,
- 0x18000000: 0x808202,
- 0x28000000: 0x8202,
- 0x38000000: 0x8000,
- 0x48000000: 0x808200,
- 0x58000000: 0x200,
- 0x68000000: 0x808002,
- 0x78000000: 0x2,
- 0x88000000: 0x800200,
- 0x98000000: 0x8200,
- 0xa8000000: 0x808000,
- 0xb8000000: 0x800202,
- 0xc8000000: 0x800002,
- 0xd8000000: 0x8002,
- 0xe8000000: 0x202,
- 0xf8000000: 0x800000,
- 0x1: 0x8000,
- 0x10000001: 0x2,
- 0x20000001: 0x808200,
- 0x30000001: 0x800000,
- 0x40000001: 0x808002,
- 0x50000001: 0x8200,
- 0x60000001: 0x200,
- 0x70000001: 0x800202,
- 0x80000001: 0x808202,
- 0x90000001: 0x808000,
- 0xa0000001: 0x800002,
- 0xb0000001: 0x8202,
- 0xc0000001: 0x202,
- 0xd0000001: 0x800200,
- 0xe0000001: 0x8002,
- 0xf0000001: 0x0,
- 0x8000001: 0x808202,
- 0x18000001: 0x808000,
- 0x28000001: 0x800000,
- 0x38000001: 0x200,
- 0x48000001: 0x8000,
- 0x58000001: 0x800002,
- 0x68000001: 0x2,
- 0x78000001: 0x8202,
- 0x88000001: 0x8002,
- 0x98000001: 0x800202,
- 0xa8000001: 0x202,
- 0xb8000001: 0x808200,
- 0xc8000001: 0x800200,
- 0xd8000001: 0x0,
- 0xe8000001: 0x8200,
- 0xf8000001: 0x808002
- },
- {
- 0x0: 0x40084010,
- 0x1000000: 0x4000,
- 0x2000000: 0x80000,
- 0x3000000: 0x40080010,
- 0x4000000: 0x40000010,
- 0x5000000: 0x40084000,
- 0x6000000: 0x40004000,
- 0x7000000: 0x10,
- 0x8000000: 0x84000,
- 0x9000000: 0x40004010,
- 0xa000000: 0x40000000,
- 0xb000000: 0x84010,
- 0xc000000: 0x80010,
- 0xd000000: 0x0,
- 0xe000000: 0x4010,
- 0xf000000: 0x40080000,
- 0x800000: 0x40004000,
- 0x1800000: 0x84010,
- 0x2800000: 0x10,
- 0x3800000: 0x40004010,
- 0x4800000: 0x40084010,
- 0x5800000: 0x40000000,
- 0x6800000: 0x80000,
- 0x7800000: 0x40080010,
- 0x8800000: 0x80010,
- 0x9800000: 0x0,
- 0xa800000: 0x4000,
- 0xb800000: 0x40080000,
- 0xc800000: 0x40000010,
- 0xd800000: 0x84000,
- 0xe800000: 0x40084000,
- 0xf800000: 0x4010,
- 0x10000000: 0x0,
- 0x11000000: 0x40080010,
- 0x12000000: 0x40004010,
- 0x13000000: 0x40084000,
- 0x14000000: 0x40080000,
- 0x15000000: 0x10,
- 0x16000000: 0x84010,
- 0x17000000: 0x4000,
- 0x18000000: 0x4010,
- 0x19000000: 0x80000,
- 0x1a000000: 0x80010,
- 0x1b000000: 0x40000010,
- 0x1c000000: 0x84000,
- 0x1d000000: 0x40004000,
- 0x1e000000: 0x40000000,
- 0x1f000000: 0x40084010,
- 0x10800000: 0x84010,
- 0x11800000: 0x80000,
- 0x12800000: 0x40080000,
- 0x13800000: 0x4000,
- 0x14800000: 0x40004000,
- 0x15800000: 0x40084010,
- 0x16800000: 0x10,
- 0x17800000: 0x40000000,
- 0x18800000: 0x40084000,
- 0x19800000: 0x40000010,
- 0x1a800000: 0x40004010,
- 0x1b800000: 0x80010,
- 0x1c800000: 0x0,
- 0x1d800000: 0x4010,
- 0x1e800000: 0x40080010,
- 0x1f800000: 0x84000
- },
- {
- 0x0: 0x104,
- 0x100000: 0x0,
- 0x200000: 0x4000100,
- 0x300000: 0x10104,
- 0x400000: 0x10004,
- 0x500000: 0x4000004,
- 0x600000: 0x4010104,
- 0x700000: 0x4010000,
- 0x800000: 0x4000000,
- 0x900000: 0x4010100,
- 0xa00000: 0x10100,
- 0xb00000: 0x4010004,
- 0xc00000: 0x4000104,
- 0xd00000: 0x10000,
- 0xe00000: 0x4,
- 0xf00000: 0x100,
- 0x80000: 0x4010100,
- 0x180000: 0x4010004,
- 0x280000: 0x0,
- 0x380000: 0x4000100,
- 0x480000: 0x4000004,
- 0x580000: 0x10000,
- 0x680000: 0x10004,
- 0x780000: 0x104,
- 0x880000: 0x4,
- 0x980000: 0x100,
- 0xa80000: 0x4010000,
- 0xb80000: 0x10104,
- 0xc80000: 0x10100,
- 0xd80000: 0x4000104,
- 0xe80000: 0x4010104,
- 0xf80000: 0x4000000,
- 0x1000000: 0x4010100,
- 0x1100000: 0x10004,
- 0x1200000: 0x10000,
- 0x1300000: 0x4000100,
- 0x1400000: 0x100,
- 0x1500000: 0x4010104,
- 0x1600000: 0x4000004,
- 0x1700000: 0x0,
- 0x1800000: 0x4000104,
- 0x1900000: 0x4000000,
- 0x1a00000: 0x4,
- 0x1b00000: 0x10100,
- 0x1c00000: 0x4010000,
- 0x1d00000: 0x104,
- 0x1e00000: 0x10104,
- 0x1f00000: 0x4010004,
- 0x1080000: 0x4000000,
- 0x1180000: 0x104,
- 0x1280000: 0x4010100,
- 0x1380000: 0x0,
- 0x1480000: 0x10004,
- 0x1580000: 0x4000100,
- 0x1680000: 0x100,
- 0x1780000: 0x4010004,
- 0x1880000: 0x10000,
- 0x1980000: 0x4010104,
- 0x1a80000: 0x10104,
- 0x1b80000: 0x4000004,
- 0x1c80000: 0x4000104,
- 0x1d80000: 0x4010000,
- 0x1e80000: 0x4,
- 0x1f80000: 0x10100
- },
- {
- 0x0: 0x80401000,
- 0x10000: 0x80001040,
- 0x20000: 0x401040,
- 0x30000: 0x80400000,
- 0x40000: 0x0,
- 0x50000: 0x401000,
- 0x60000: 0x80000040,
- 0x70000: 0x400040,
- 0x80000: 0x80000000,
- 0x90000: 0x400000,
- 0xa0000: 0x40,
- 0xb0000: 0x80001000,
- 0xc0000: 0x80400040,
- 0xd0000: 0x1040,
- 0xe0000: 0x1000,
- 0xf0000: 0x80401040,
- 0x8000: 0x80001040,
- 0x18000: 0x40,
- 0x28000: 0x80400040,
- 0x38000: 0x80001000,
- 0x48000: 0x401000,
- 0x58000: 0x80401040,
- 0x68000: 0x0,
- 0x78000: 0x80400000,
- 0x88000: 0x1000,
- 0x98000: 0x80401000,
- 0xa8000: 0x400000,
- 0xb8000: 0x1040,
- 0xc8000: 0x80000000,
- 0xd8000: 0x400040,
- 0xe8000: 0x401040,
- 0xf8000: 0x80000040,
- 0x100000: 0x400040,
- 0x110000: 0x401000,
- 0x120000: 0x80000040,
- 0x130000: 0x0,
- 0x140000: 0x1040,
- 0x150000: 0x80400040,
- 0x160000: 0x80401000,
- 0x170000: 0x80001040,
- 0x180000: 0x80401040,
- 0x190000: 0x80000000,
- 0x1a0000: 0x80400000,
- 0x1b0000: 0x401040,
- 0x1c0000: 0x80001000,
- 0x1d0000: 0x400000,
- 0x1e0000: 0x40,
- 0x1f0000: 0x1000,
- 0x108000: 0x80400000,
- 0x118000: 0x80401040,
- 0x128000: 0x0,
- 0x138000: 0x401000,
- 0x148000: 0x400040,
- 0x158000: 0x80000000,
- 0x168000: 0x80001040,
- 0x178000: 0x40,
- 0x188000: 0x80000040,
- 0x198000: 0x1000,
- 0x1a8000: 0x80001000,
- 0x1b8000: 0x80400040,
- 0x1c8000: 0x1040,
- 0x1d8000: 0x80401000,
- 0x1e8000: 0x400000,
- 0x1f8000: 0x401040
- },
- {
- 0x0: 0x80,
- 0x1000: 0x1040000,
- 0x2000: 0x40000,
- 0x3000: 0x20000000,
- 0x4000: 0x20040080,
- 0x5000: 0x1000080,
- 0x6000: 0x21000080,
- 0x7000: 0x40080,
- 0x8000: 0x1000000,
- 0x9000: 0x20040000,
- 0xa000: 0x20000080,
- 0xb000: 0x21040080,
- 0xc000: 0x21040000,
- 0xd000: 0x0,
- 0xe000: 0x1040080,
- 0xf000: 0x21000000,
- 0x800: 0x1040080,
- 0x1800: 0x21000080,
- 0x2800: 0x80,
- 0x3800: 0x1040000,
- 0x4800: 0x40000,
- 0x5800: 0x20040080,
- 0x6800: 0x21040000,
- 0x7800: 0x20000000,
- 0x8800: 0x20040000,
- 0x9800: 0x0,
- 0xa800: 0x21040080,
- 0xb800: 0x1000080,
- 0xc800: 0x20000080,
- 0xd800: 0x21000000,
- 0xe800: 0x1000000,
- 0xf800: 0x40080,
- 0x10000: 0x40000,
- 0x11000: 0x80,
- 0x12000: 0x20000000,
- 0x13000: 0x21000080,
- 0x14000: 0x1000080,
- 0x15000: 0x21040000,
- 0x16000: 0x20040080,
- 0x17000: 0x1000000,
- 0x18000: 0x21040080,
- 0x19000: 0x21000000,
- 0x1a000: 0x1040000,
- 0x1b000: 0x20040000,
- 0x1c000: 0x40080,
- 0x1d000: 0x20000080,
- 0x1e000: 0x0,
- 0x1f000: 0x1040080,
- 0x10800: 0x21000080,
- 0x11800: 0x1000000,
- 0x12800: 0x1040000,
- 0x13800: 0x20040080,
- 0x14800: 0x20000000,
- 0x15800: 0x1040080,
- 0x16800: 0x80,
- 0x17800: 0x21040000,
- 0x18800: 0x40080,
- 0x19800: 0x21040080,
- 0x1a800: 0x0,
- 0x1b800: 0x21000000,
- 0x1c800: 0x1000080,
- 0x1d800: 0x40000,
- 0x1e800: 0x20040000,
- 0x1f800: 0x20000080
- },
- {
- 0x0: 0x10000008,
- 0x100: 0x2000,
- 0x200: 0x10200000,
- 0x300: 0x10202008,
- 0x400: 0x10002000,
- 0x500: 0x200000,
- 0x600: 0x200008,
- 0x700: 0x10000000,
- 0x800: 0x0,
- 0x900: 0x10002008,
- 0xa00: 0x202000,
- 0xb00: 0x8,
- 0xc00: 0x10200008,
- 0xd00: 0x202008,
- 0xe00: 0x2008,
- 0xf00: 0x10202000,
- 0x80: 0x10200000,
- 0x180: 0x10202008,
- 0x280: 0x8,
- 0x380: 0x200000,
- 0x480: 0x202008,
- 0x580: 0x10000008,
- 0x680: 0x10002000,
- 0x780: 0x2008,
- 0x880: 0x200008,
- 0x980: 0x2000,
- 0xa80: 0x10002008,
- 0xb80: 0x10200008,
- 0xc80: 0x0,
- 0xd80: 0x10202000,
- 0xe80: 0x202000,
- 0xf80: 0x10000000,
- 0x1000: 0x10002000,
- 0x1100: 0x10200008,
- 0x1200: 0x10202008,
- 0x1300: 0x2008,
- 0x1400: 0x200000,
- 0x1500: 0x10000000,
- 0x1600: 0x10000008,
- 0x1700: 0x202000,
- 0x1800: 0x202008,
- 0x1900: 0x0,
- 0x1a00: 0x8,
- 0x1b00: 0x10200000,
- 0x1c00: 0x2000,
- 0x1d00: 0x10002008,
- 0x1e00: 0x10202000,
- 0x1f00: 0x200008,
- 0x1080: 0x8,
- 0x1180: 0x202000,
- 0x1280: 0x200000,
- 0x1380: 0x10000008,
- 0x1480: 0x10002000,
- 0x1580: 0x2008,
- 0x1680: 0x10202008,
- 0x1780: 0x10200000,
- 0x1880: 0x10202000,
- 0x1980: 0x10200008,
- 0x1a80: 0x2000,
- 0x1b80: 0x202008,
- 0x1c80: 0x200008,
- 0x1d80: 0x0,
- 0x1e80: 0x10000000,
- 0x1f80: 0x10002008
- },
- {
- 0x0: 0x100000,
- 0x10: 0x2000401,
- 0x20: 0x400,
- 0x30: 0x100401,
- 0x40: 0x2100401,
- 0x50: 0x0,
- 0x60: 0x1,
- 0x70: 0x2100001,
- 0x80: 0x2000400,
- 0x90: 0x100001,
- 0xa0: 0x2000001,
- 0xb0: 0x2100400,
- 0xc0: 0x2100000,
- 0xd0: 0x401,
- 0xe0: 0x100400,
- 0xf0: 0x2000000,
- 0x8: 0x2100001,
- 0x18: 0x0,
- 0x28: 0x2000401,
- 0x38: 0x2100400,
- 0x48: 0x100000,
- 0x58: 0x2000001,
- 0x68: 0x2000000,
- 0x78: 0x401,
- 0x88: 0x100401,
- 0x98: 0x2000400,
- 0xa8: 0x2100000,
- 0xb8: 0x100001,
- 0xc8: 0x400,
- 0xd8: 0x2100401,
- 0xe8: 0x1,
- 0xf8: 0x100400,
- 0x100: 0x2000000,
- 0x110: 0x100000,
- 0x120: 0x2000401,
- 0x130: 0x2100001,
- 0x140: 0x100001,
- 0x150: 0x2000400,
- 0x160: 0x2100400,
- 0x170: 0x100401,
- 0x180: 0x401,
- 0x190: 0x2100401,
- 0x1a0: 0x100400,
- 0x1b0: 0x1,
- 0x1c0: 0x0,
- 0x1d0: 0x2100000,
- 0x1e0: 0x2000001,
- 0x1f0: 0x400,
- 0x108: 0x100400,
- 0x118: 0x2000401,
- 0x128: 0x2100001,
- 0x138: 0x1,
- 0x148: 0x2000000,
- 0x158: 0x100000,
- 0x168: 0x401,
- 0x178: 0x2100400,
- 0x188: 0x2000001,
- 0x198: 0x2100000,
- 0x1a8: 0x0,
- 0x1b8: 0x2100401,
- 0x1c8: 0x100401,
- 0x1d8: 0x400,
- 0x1e8: 0x2000400,
- 0x1f8: 0x100001
- },
- {
- 0x0: 0x8000820,
- 0x1: 0x20000,
- 0x2: 0x8000000,
- 0x3: 0x20,
- 0x4: 0x20020,
- 0x5: 0x8020820,
- 0x6: 0x8020800,
- 0x7: 0x800,
- 0x8: 0x8020000,
- 0x9: 0x8000800,
- 0xa: 0x20800,
- 0xb: 0x8020020,
- 0xc: 0x820,
- 0xd: 0x0,
- 0xe: 0x8000020,
- 0xf: 0x20820,
- 0x80000000: 0x800,
- 0x80000001: 0x8020820,
- 0x80000002: 0x8000820,
- 0x80000003: 0x8000000,
- 0x80000004: 0x8020000,
- 0x80000005: 0x20800,
- 0x80000006: 0x20820,
- 0x80000007: 0x20,
- 0x80000008: 0x8000020,
- 0x80000009: 0x820,
- 0x8000000a: 0x20020,
- 0x8000000b: 0x8020800,
- 0x8000000c: 0x0,
- 0x8000000d: 0x8020020,
- 0x8000000e: 0x8000800,
- 0x8000000f: 0x20000,
- 0x10: 0x20820,
- 0x11: 0x8020800,
- 0x12: 0x20,
- 0x13: 0x800,
- 0x14: 0x8000800,
- 0x15: 0x8000020,
- 0x16: 0x8020020,
- 0x17: 0x20000,
- 0x18: 0x0,
- 0x19: 0x20020,
- 0x1a: 0x8020000,
- 0x1b: 0x8000820,
- 0x1c: 0x8020820,
- 0x1d: 0x20800,
- 0x1e: 0x820,
- 0x1f: 0x8000000,
- 0x80000010: 0x20000,
- 0x80000011: 0x800,
- 0x80000012: 0x8020020,
- 0x80000013: 0x20820,
- 0x80000014: 0x20,
- 0x80000015: 0x8020000,
- 0x80000016: 0x8000000,
- 0x80000017: 0x8000820,
- 0x80000018: 0x8020820,
- 0x80000019: 0x8000020,
- 0x8000001a: 0x8000800,
- 0x8000001b: 0x0,
- 0x8000001c: 0x20800,
- 0x8000001d: 0x820,
- 0x8000001e: 0x20020,
- 0x8000001f: 0x8020800
- }
- ];
-
- // Masks that select the SBOX input
- var SBOX_MASK = [
- 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,
- 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f
- ];
-
- /**
- * DES block cipher algorithm.
- */
- var DES = C_algo.DES = BlockCipher.extend({
- _doReset: function () {
- // Shortcuts
- var key = this._key;
- var keyWords = key.words;
-
- // Select 56 bits according to PC1
- var keyBits = [];
- for (var i = 0; i < 56; i++) {
- var keyBitPos = PC1[i] - 1;
- keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;
- }
-
- // Assemble 16 subkeys
- var subKeys = this._subKeys = [];
- for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
- // Create subkey
- var subKey = subKeys[nSubKey] = [];
-
- // Shortcut
- var bitShift = BIT_SHIFTS[nSubKey];
-
- // Select 48 bits according to PC2
- for (var i = 0; i < 24; i++) {
- // Select from the left 28 key bits
- subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);
-
- // Select from the right 28 key bits
- subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);
- }
-
- // Since each subkey is applied to an expanded 32-bit input,
- // the subkey can be broken into 8 values scaled to 32-bits,
- // which allows the key to be used without expansion
- subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);
- for (var i = 1; i < 7; i++) {
- subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);
- }
- subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);
- }
-
- // Compute inverse subkeys
- var invSubKeys = this._invSubKeys = [];
- for (var i = 0; i < 16; i++) {
- invSubKeys[i] = subKeys[15 - i];
- }
- },
-
- encryptBlock: function (M, offset) {
- this._doCryptBlock(M, offset, this._subKeys);
- },
-
- decryptBlock: function (M, offset) {
- this._doCryptBlock(M, offset, this._invSubKeys);
- },
-
- _doCryptBlock: function (M, offset, subKeys) {
- // Get input
- this._lBlock = M[offset];
- this._rBlock = M[offset + 1];
-
- // Initial permutation
- exchangeLR.call(this, 4, 0x0f0f0f0f);
- exchangeLR.call(this, 16, 0x0000ffff);
- exchangeRL.call(this, 2, 0x33333333);
- exchangeRL.call(this, 8, 0x00ff00ff);
- exchangeLR.call(this, 1, 0x55555555);
-
- // Rounds
- for (var round = 0; round < 16; round++) {
- // Shortcuts
- var subKey = subKeys[round];
- var lBlock = this._lBlock;
- var rBlock = this._rBlock;
-
- // Feistel function
- var f = 0;
- for (var i = 0; i < 8; i++) {
- f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
- }
- this._lBlock = rBlock;
- this._rBlock = lBlock ^ f;
- }
-
- // Undo swap from last round
- var t = this._lBlock;
- this._lBlock = this._rBlock;
- this._rBlock = t;
-
- // Final permutation
- exchangeLR.call(this, 1, 0x55555555);
- exchangeRL.call(this, 8, 0x00ff00ff);
- exchangeRL.call(this, 2, 0x33333333);
- exchangeLR.call(this, 16, 0x0000ffff);
- exchangeLR.call(this, 4, 0x0f0f0f0f);
-
- // Set output
- M[offset] = this._lBlock;
- M[offset + 1] = this._rBlock;
- },
-
- keySize: 64/32,
-
- ivSize: 64/32,
-
- blockSize: 64/32
- });
-
- // Swap bits across the left and right words
- function exchangeLR(offset, mask) {
- var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;
- this._rBlock ^= t;
- this._lBlock ^= t << offset;
- }
-
- function exchangeRL(offset, mask) {
- var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;
- this._lBlock ^= t;
- this._rBlock ^= t << offset;
- }
-
- /**
- * Shortcut functions to the cipher's object interface.
- *
- * @example
- *
- * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);
- * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);
- */
- C.DES = BlockCipher._createHelper(DES);
-
- /**
- * Triple-DES block cipher algorithm.
- */
- var TripleDES = C_algo.TripleDES = BlockCipher.extend({
- _doReset: function () {
- // Shortcuts
- var key = this._key;
- var keyWords = key.words;
- // Make sure the key length is valid (64, 128 or >= 192 bit)
- if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) {
- throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.');
- }
-
- // Extend the key according to the keying options defined in 3DES standard
- var key1 = keyWords.slice(0, 2);
- var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4);
- var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6);
-
- // Create DES instances
- this._des1 = DES.createEncryptor(WordArray.create(key1));
- this._des2 = DES.createEncryptor(WordArray.create(key2));
- this._des3 = DES.createEncryptor(WordArray.create(key3));
- },
-
- encryptBlock: function (M, offset) {
- this._des1.encryptBlock(M, offset);
- this._des2.decryptBlock(M, offset);
- this._des3.encryptBlock(M, offset);
- },
-
- decryptBlock: function (M, offset) {
- this._des3.decryptBlock(M, offset);
- this._des2.encryptBlock(M, offset);
- this._des1.decryptBlock(M, offset);
- },
-
- keySize: 192/32,
-
- ivSize: 64/32,
-
- blockSize: 64/32
- });
-
- /**
- * Shortcut functions to the cipher's object interface.
- *
- * @example
- *
- * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);
- * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);
- */
- C.TripleDES = BlockCipher._createHelper(TripleDES);
- }());
-
-
- return CryptoJS.TripleDES;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/crypto-js/x64-core.js":
-/*!********************************************!*\
- !*** ./node_modules/crypto-js/x64-core.js ***!
- \********************************************/
-/***/ (function(module, exports, __webpack_require__) {
-
-;(function (root, factory) {
- if (true) {
- // CommonJS
- module.exports = exports = factory(__webpack_require__(/*! ./core */ "./node_modules/crypto-js/core.js"));
- }
- else {}
-}(this, function (CryptoJS) {
-
- (function (undefined) {
- // Shortcuts
- var C = CryptoJS;
- var C_lib = C.lib;
- var Base = C_lib.Base;
- var X32WordArray = C_lib.WordArray;
-
- /**
- * x64 namespace.
- */
- var C_x64 = C.x64 = {};
-
- /**
- * A 64-bit word.
- */
- var X64Word = C_x64.Word = Base.extend({
- /**
- * Initializes a newly created 64-bit word.
- *
- * @param {number} high The high 32 bits.
- * @param {number} low The low 32 bits.
- *
- * @example
- *
- * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
- */
- init: function (high, low) {
- this.high = high;
- this.low = low;
- }
-
- /**
- * Bitwise NOTs this word.
- *
- * @return {X64Word} A new x64-Word object after negating.
- *
- * @example
- *
- * var negated = x64Word.not();
- */
- // not: function () {
- // var high = ~this.high;
- // var low = ~this.low;
-
- // return X64Word.create(high, low);
- // },
-
- /**
- * Bitwise ANDs this word with the passed word.
- *
- * @param {X64Word} word The x64-Word to AND with this word.
- *
- * @return {X64Word} A new x64-Word object after ANDing.
- *
- * @example
- *
- * var anded = x64Word.and(anotherX64Word);
- */
- // and: function (word) {
- // var high = this.high & word.high;
- // var low = this.low & word.low;
-
- // return X64Word.create(high, low);
- // },
-
- /**
- * Bitwise ORs this word with the passed word.
- *
- * @param {X64Word} word The x64-Word to OR with this word.
- *
- * @return {X64Word} A new x64-Word object after ORing.
- *
- * @example
- *
- * var ored = x64Word.or(anotherX64Word);
- */
- // or: function (word) {
- // var high = this.high | word.high;
- // var low = this.low | word.low;
-
- // return X64Word.create(high, low);
- // },
-
- /**
- * Bitwise XORs this word with the passed word.
- *
- * @param {X64Word} word The x64-Word to XOR with this word.
- *
- * @return {X64Word} A new x64-Word object after XORing.
- *
- * @example
- *
- * var xored = x64Word.xor(anotherX64Word);
- */
- // xor: function (word) {
- // var high = this.high ^ word.high;
- // var low = this.low ^ word.low;
-
- // return X64Word.create(high, low);
- // },
-
- /**
- * Shifts this word n bits to the left.
- *
- * @param {number} n The number of bits to shift.
- *
- * @return {X64Word} A new x64-Word object after shifting.
- *
- * @example
- *
- * var shifted = x64Word.shiftL(25);
- */
- // shiftL: function (n) {
- // if (n < 32) {
- // var high = (this.high << n) | (this.low >>> (32 - n));
- // var low = this.low << n;
- // } else {
- // var high = this.low << (n - 32);
- // var low = 0;
- // }
-
- // return X64Word.create(high, low);
- // },
-
- /**
- * Shifts this word n bits to the right.
- *
- * @param {number} n The number of bits to shift.
- *
- * @return {X64Word} A new x64-Word object after shifting.
- *
- * @example
- *
- * var shifted = x64Word.shiftR(7);
- */
- // shiftR: function (n) {
- // if (n < 32) {
- // var low = (this.low >>> n) | (this.high << (32 - n));
- // var high = this.high >>> n;
- // } else {
- // var low = this.high >>> (n - 32);
- // var high = 0;
- // }
-
- // return X64Word.create(high, low);
- // },
-
- /**
- * Rotates this word n bits to the left.
- *
- * @param {number} n The number of bits to rotate.
- *
- * @return {X64Word} A new x64-Word object after rotating.
- *
- * @example
- *
- * var rotated = x64Word.rotL(25);
- */
- // rotL: function (n) {
- // return this.shiftL(n).or(this.shiftR(64 - n));
- // },
-
- /**
- * Rotates this word n bits to the right.
- *
- * @param {number} n The number of bits to rotate.
- *
- * @return {X64Word} A new x64-Word object after rotating.
- *
- * @example
- *
- * var rotated = x64Word.rotR(7);
- */
- // rotR: function (n) {
- // return this.shiftR(n).or(this.shiftL(64 - n));
- // },
-
- /**
- * Adds this word with the passed word.
- *
- * @param {X64Word} word The x64-Word to add with this word.
- *
- * @return {X64Word} A new x64-Word object after adding.
- *
- * @example
- *
- * var added = x64Word.add(anotherX64Word);
- */
- // add: function (word) {
- // var low = (this.low + word.low) | 0;
- // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
- // var high = (this.high + word.high + carry) | 0;
-
- // return X64Word.create(high, low);
- // }
- });
-
- /**
- * An array of 64-bit words.
- *
- * @property {Array} words The array of CryptoJS.x64.Word objects.
- * @property {number} sigBytes The number of significant bytes in this word array.
- */
- var X64WordArray = C_x64.WordArray = Base.extend({
- /**
- * Initializes a newly created word array.
- *
- * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
- * @param {number} sigBytes (Optional) The number of significant bytes in the words.
- *
- * @example
- *
- * var wordArray = CryptoJS.x64.WordArray.create();
- *
- * var wordArray = CryptoJS.x64.WordArray.create([
- * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
- * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
- * ]);
- *
- * var wordArray = CryptoJS.x64.WordArray.create([
- * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
- * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
- * ], 10);
- */
- init: function (words, sigBytes) {
- words = this.words = words || [];
-
- if (sigBytes != undefined) {
- this.sigBytes = sigBytes;
- } else {
- this.sigBytes = words.length * 8;
- }
- },
-
- /**
- * Converts this 64-bit word array to a 32-bit word array.
- *
- * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
- *
- * @example
- *
- * var x32WordArray = x64WordArray.toX32();
- */
- toX32: function () {
- // Shortcuts
- var x64Words = this.words;
- var x64WordsLength = x64Words.length;
-
- // Convert
- var x32Words = [];
- for (var i = 0; i < x64WordsLength; i++) {
- var x64Word = x64Words[i];
- x32Words.push(x64Word.high);
- x32Words.push(x64Word.low);
- }
-
- return X32WordArray.create(x32Words, this.sigBytes);
- },
-
- /**
- * Creates a copy of this word array.
- *
- * @return {X64WordArray} The clone.
- *
- * @example
- *
- * var clone = x64WordArray.clone();
- */
- clone: function () {
- var clone = Base.clone.call(this);
-
- // Clone "words" array
- var words = clone.words = this.words.slice(0);
-
- // Clone each X64Word object
- var wordsLength = words.length;
- for (var i = 0; i < wordsLength; i++) {
- words[i] = words[i].clone();
- }
-
- return clone;
- }
- });
- }());
-
-
- return CryptoJS;
-
-}));
-
-/***/ }),
-
-/***/ "./node_modules/desandro-matches-selector/matches-selector.js":
-/*!********************************************************************!*\
- !*** ./node_modules/desandro-matches-selector/matches-selector.js ***!
- \********************************************************************/
-/***/ ((module, exports, __webpack_require__) => {
-
-var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
- * matchesSelector v2.0.2
- * matchesSelector( element, '.selector' )
- * MIT license
- */
-
-/*jshint browser: true, strict: true, undef: true, unused: true */
-
-( function( window, factory ) {
- /*global define: false, module: false */
- 'use strict';
- // universal module definition
- if ( true ) {
- // AMD
- !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
- __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
-
-}( window, function factory() {
- 'use strict';
-
- var matchesMethod = ( function() {
- var ElemProto = window.Element.prototype;
- // check for the standard method name first
- if ( ElemProto.matches ) {
- return 'matches';
- }
- // check un-prefixed
- if ( ElemProto.matchesSelector ) {
- return 'matchesSelector';
- }
- // check vendor prefixes
- var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];
-
- for ( var i=0; i < prefixes.length; i++ ) {
- var prefix = prefixes[i];
- var method = prefix + 'MatchesSelector';
- if ( ElemProto[ method ] ) {
- return method;
- }
- }
- })();
-
- return function matchesSelector( elem, selector ) {
- return elem[ matchesMethod ]( selector );
- };
-
-}));
-
-
-/***/ }),
-
-/***/ "./node_modules/ev-emitter/ev-emitter.js":
-/*!***********************************************!*\
- !*** ./node_modules/ev-emitter/ev-emitter.js ***!
- \***********************************************/
-/***/ (function(module) {
-
-/**
- * EvEmitter v2.1.1
- * Lil' event emitter
- * MIT License
- */
-
-( function( global, factory ) {
- // universal module definition
- if ( true && module.exports ) {
- // CommonJS - Browserify, Webpack
- module.exports = factory();
- } else {
- // Browser globals
- global.EvEmitter = factory();
- }
-
-}( typeof window != 'undefined' ? window : this, function() {
-
-function EvEmitter() {}
-
-let proto = EvEmitter.prototype;
-
-proto.on = function( eventName, listener ) {
- if ( !eventName || !listener ) return this;
-
- // set events hash
- let events = this._events = this._events || {};
- // set listeners array
- let listeners = events[ eventName ] = events[ eventName ] || [];
- // only add once
- if ( !listeners.includes( listener ) ) {
- listeners.push( listener );
- }
-
- return this;
-};
-
-proto.once = function( eventName, listener ) {
- if ( !eventName || !listener ) return this;
-
- // add event
- this.on( eventName, listener );
- // set once flag
- // set onceEvents hash
- let onceEvents = this._onceEvents = this._onceEvents || {};
- // set onceListeners object
- let onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
- // set flag
- onceListeners[ listener ] = true;
-
- return this;
-};
-
-proto.off = function( eventName, listener ) {
- let listeners = this._events && this._events[ eventName ];
- if ( !listeners || !listeners.length ) return this;
-
- let index = listeners.indexOf( listener );
- if ( index != -1 ) {
- listeners.splice( index, 1 );
- }
-
- return this;
-};
-
-proto.emitEvent = function( eventName, args ) {
- let listeners = this._events && this._events[ eventName ];
- if ( !listeners || !listeners.length ) return this;
-
- // copy over to avoid interference if .off() in listener
- listeners = listeners.slice( 0 );
- args = args || [];
- // once stuff
- let onceListeners = this._onceEvents && this._onceEvents[ eventName ];
-
- for ( let listener of listeners ) {
- let isOnce = onceListeners && onceListeners[ listener ];
- if ( isOnce ) {
- // remove listener
- // remove before trigger to prevent recursion
- this.off( eventName, listener );
- // unset once flag
- delete onceListeners[ listener ];
- }
- // trigger listener
- listener.apply( this, args );
- }
-
- return this;
-};
-
-proto.allOff = function() {
- delete this._events;
- delete this._onceEvents;
- return this;
-};
-
-return EvEmitter;
-
-} ) );
-
-
-/***/ }),
-
-/***/ "./node_modules/fizzy-ui-utils/utils.js":
-/*!**********************************************!*\
- !*** ./node_modules/fizzy-ui-utils/utils.js ***!
- \**********************************************/
-/***/ ((module, exports, __webpack_require__) => {
-
-var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
- * Fizzy UI utils v2.0.7
- * MIT license
- */
-
-/*jshint browser: true, undef: true, unused: true, strict: true */
-
-( function( window, factory ) {
- // universal module definition
- /*jshint strict: false */ /*globals define, module, require */
-
- if ( true ) {
- // AMD
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [
- __webpack_require__(/*! desandro-matches-selector/matches-selector */ "./node_modules/desandro-matches-selector/matches-selector.js")
- ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( matchesSelector ) {
- return factory( window, matchesSelector );
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
-
-}( window, function factory( window, matchesSelector ) {
-
-'use strict';
-
-var utils = {};
-
-// ----- extend ----- //
-
-// extends objects
-utils.extend = function( a, b ) {
- for ( var prop in b ) {
- a[ prop ] = b[ prop ];
- }
- return a;
-};
-
-// ----- modulo ----- //
-
-utils.modulo = function( num, div ) {
- return ( ( num % div ) + div ) % div;
-};
-
-// ----- makeArray ----- //
-
-var arraySlice = Array.prototype.slice;
-
-// turn element or nodeList into an array
-utils.makeArray = function( obj ) {
- if ( Array.isArray( obj ) ) {
- // use object if already an array
- return obj;
- }
- // return empty array if undefined or null. #6
- if ( obj === null || obj === undefined ) {
- return [];
- }
-
- var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
- if ( isArrayLike ) {
- // convert nodeList to array
- return arraySlice.call( obj );
- }
-
- // array of single index
- return [ obj ];
-};
-
-// ----- removeFrom ----- //
-
-utils.removeFrom = function( ary, obj ) {
- var index = ary.indexOf( obj );
- if ( index != -1 ) {
- ary.splice( index, 1 );
- }
-};
-
-// ----- getParent ----- //
-
-utils.getParent = function( elem, selector ) {
- while ( elem.parentNode && elem != document.body ) {
- elem = elem.parentNode;
- if ( matchesSelector( elem, selector ) ) {
- return elem;
- }
- }
-};
-
-// ----- getQueryElement ----- //
-
-// use element as selector string
-utils.getQueryElement = function( elem ) {
- if ( typeof elem == 'string' ) {
- return document.querySelector( elem );
- }
- return elem;
-};
-
-// ----- handleEvent ----- //
-
-// enable .ontype to trigger from .addEventListener( elem, 'type' )
-utils.handleEvent = function( event ) {
- var method = 'on' + event.type;
- if ( this[ method ] ) {
- this[ method ]( event );
- }
-};
-
-// ----- filterFindElements ----- //
-
-utils.filterFindElements = function( elems, selector ) {
- // make array of elems
- elems = utils.makeArray( elems );
- var ffElems = [];
-
- elems.forEach( function( elem ) {
- // check that elem is an actual element
- if ( !( elem instanceof HTMLElement ) ) {
- return;
- }
- // add elem if no selector
- if ( !selector ) {
- ffElems.push( elem );
- return;
- }
- // filter & find items if we have a selector
- // filter
- if ( matchesSelector( elem, selector ) ) {
- ffElems.push( elem );
- }
- // find children
- var childElems = elem.querySelectorAll( selector );
- // concat childElems to filterFound array
- for ( var i=0; i < childElems.length; i++ ) {
- ffElems.push( childElems[i] );
- }
- });
-
- return ffElems;
-};
-
-// ----- debounceMethod ----- //
-
-utils.debounceMethod = function( _class, methodName, threshold ) {
- threshold = threshold || 100;
- // original method
- var method = _class.prototype[ methodName ];
- var timeoutName = methodName + 'Timeout';
-
- _class.prototype[ methodName ] = function() {
- var timeout = this[ timeoutName ];
- clearTimeout( timeout );
-
- var args = arguments;
- var _this = this;
- this[ timeoutName ] = setTimeout( function() {
- method.apply( _this, args );
- delete _this[ timeoutName ];
- }, threshold );
- };
-};
-
-// ----- docReady ----- //
-
-utils.docReady = function( callback ) {
- var readyState = document.readyState;
- if ( readyState == 'complete' || readyState == 'interactive' ) {
- // do async to allow for other scripts to run. metafizzy/flickity#441
- setTimeout( callback );
- } else {
- document.addEventListener( 'DOMContentLoaded', callback );
- }
-};
-
-// ----- htmlInit ----- //
-
-// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/
-utils.toDashed = function( str ) {
- return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {
- return $1 + '-' + $2;
- }).toLowerCase();
-};
-
-var console = window.console;
-/**
- * allow user to initialize classes via [data-namespace] or .js-namespace class
- * htmlInit( Widget, 'widgetName' )
- * options are parsed from data-namespace-options
- */
-utils.htmlInit = function( WidgetClass, namespace ) {
- utils.docReady( function() {
- var dashedNamespace = utils.toDashed( namespace );
- var dataAttr = 'data-' + dashedNamespace;
- var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' );
- var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace );
- var elems = utils.makeArray( dataAttrElems )
- .concat( utils.makeArray( jsDashElems ) );
- var dataOptionsAttr = dataAttr + '-options';
- var jQuery = window.jQuery;
-
- elems.forEach( function( elem ) {
- var attr = elem.getAttribute( dataAttr ) ||
- elem.getAttribute( dataOptionsAttr );
- var options;
- try {
- options = attr && JSON.parse( attr );
- } catch ( error ) {
- // log error, do not initialize
- if ( console ) {
- console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +
- ': ' + error );
- }
- return;
- }
- // initialize
- var instance = new WidgetClass( elem, options );
- // make available via $().data('namespace')
- if ( jQuery ) {
- jQuery.data( elem, namespace, instance );
- }
- });
-
- });
-};
-
-// ----- ----- //
-
-return utils;
-
-}));
-
-
-/***/ }),
-
-/***/ "./node_modules/get-size/get-size.js":
-/*!*******************************************!*\
- !*** ./node_modules/get-size/get-size.js ***!
- \*******************************************/
-/***/ ((module, exports, __webpack_require__) => {
-
-var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- * getSize v2.0.3
- * measure size of elements
- * MIT license
- */
-
-/* jshint browser: true, strict: true, undef: true, unused: true */
-/* globals console: false */
-
-( function( window, factory ) {
- /* jshint strict: false */ /* globals define, module */
- if ( true ) {
- // AMD
- !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
- (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
- __WEBPACK_AMD_DEFINE_FACTORY__),
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {}
-
-})( window, function factory() {
-'use strict';
-
-// -------------------------- helpers -------------------------- //
-
-// get a number from a string, not a percentage
-function getStyleSize( value ) {
- var num = parseFloat( value );
- // not a percent like '100%', and a number
- var isValid = value.indexOf('%') == -1 && !isNaN( num );
- return isValid && num;
-}
-
-function noop() {}
-
-var logError = typeof console == 'undefined' ? noop :
- function( message ) {
- console.error( message );
- };
-
-// -------------------------- measurements -------------------------- //
-
-var measurements = [
- 'paddingLeft',
- 'paddingRight',
- 'paddingTop',
- 'paddingBottom',
- 'marginLeft',
- 'marginRight',
- 'marginTop',
- 'marginBottom',
- 'borderLeftWidth',
- 'borderRightWidth',
- 'borderTopWidth',
- 'borderBottomWidth'
-];
-
-var measurementsLength = measurements.length;
-
-function getZeroSize() {
- var size = {
- width: 0,
- height: 0,
- innerWidth: 0,
- innerHeight: 0,
- outerWidth: 0,
- outerHeight: 0
- };
- for ( var i=0; i < measurementsLength; i++ ) {
- var measurement = measurements[i];
- size[ measurement ] = 0;
- }
- return size;
-}
-
-// -------------------------- getStyle -------------------------- //
-
-/**
- * getStyle, get style of element, check for Firefox bug
- * https://bugzilla.mozilla.org/show_bug.cgi?id=548397
- */
-function getStyle( elem ) {
- var style = getComputedStyle( elem );
- if ( !style ) {
- logError( 'Style returned ' + style +
- '. Are you running this code in a hidden iframe on Firefox? ' +
- 'See https://bit.ly/getsizebug1' );
- }
- return style;
-}
-
-// -------------------------- setup -------------------------- //
-
-var isSetup = false;
-
-var isBoxSizeOuter;
-
-/**
- * setup
- * check isBoxSizerOuter
- * do on first getSize() rather than on page load for Firefox bug
- */
-function setup() {
- // setup once
- if ( isSetup ) {
- return;
- }
- isSetup = true;
-
- // -------------------------- box sizing -------------------------- //
-
- /**
- * Chrome & Safari measure the outer-width on style.width on border-box elems
- * IE11 & Firefox<29 measures the inner-width
- */
- var div = document.createElement('div');
- div.style.width = '200px';
- div.style.padding = '1px 2px 3px 4px';
- div.style.borderStyle = 'solid';
- div.style.borderWidth = '1px 2px 3px 4px';
- div.style.boxSizing = 'border-box';
-
- var body = document.body || document.documentElement;
- body.appendChild( div );
- var style = getStyle( div );
- // round value for browser zoom. desandro/masonry#928
- isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200;
- getSize.isBoxSizeOuter = isBoxSizeOuter;
-
- body.removeChild( div );
-}
-
-// -------------------------- getSize -------------------------- //
-
-function getSize( elem ) {
- setup();
-
- // use querySeletor if elem is string
- if ( typeof elem == 'string' ) {
- elem = document.querySelector( elem );
- }
-
- // do not proceed on non-objects
- if ( !elem || typeof elem != 'object' || !elem.nodeType ) {
- return;
- }
-
- var style = getStyle( elem );
-
- // if hidden, everything is 0
- if ( style.display == 'none' ) {
- return getZeroSize();
- }
-
- var size = {};
- size.width = elem.offsetWidth;
- size.height = elem.offsetHeight;
-
- var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box';
-
- // get all measurements
- for ( var i=0; i < measurementsLength; i++ ) {
- var measurement = measurements[i];
- var value = style[ measurement ];
- var num = parseFloat( value );
- // any 'auto', 'medium' value will be 0
- size[ measurement ] = !isNaN( num ) ? num : 0;
- }
-
- var paddingWidth = size.paddingLeft + size.paddingRight;
- var paddingHeight = size.paddingTop + size.paddingBottom;
- var marginWidth = size.marginLeft + size.marginRight;
- var marginHeight = size.marginTop + size.marginBottom;
- var borderWidth = size.borderLeftWidth + size.borderRightWidth;
- var borderHeight = size.borderTopWidth + size.borderBottomWidth;
-
- var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;
-
- // overwrite width and height if we can get it from style
- var styleWidth = getStyleSize( style.width );
- if ( styleWidth !== false ) {
- size.width = styleWidth +
- // add padding and border unless it's already including it
- ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth );
- }
-
- var styleHeight = getStyleSize( style.height );
- if ( styleHeight !== false ) {
- size.height = styleHeight +
- // add padding and border unless it's already including it
- ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight );
- }
-
- size.innerWidth = size.width - ( paddingWidth + borderWidth );
- size.innerHeight = size.height - ( paddingHeight + borderHeight );
-
- size.outerWidth = size.width + marginWidth;
- size.outerHeight = size.height + marginHeight;
-
- return size;
-}
-
-return getSize;
-
-});
-
-
-/***/ }),
-
-/***/ "./node_modules/imagesloaded/imagesloaded.js":
-/*!***************************************************!*\
- !*** ./node_modules/imagesloaded/imagesloaded.js ***!
- \***************************************************/
-/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
-
-/*!
- * imagesLoaded v5.0.0
- * JavaScript is all like "You images are done yet or what?"
- * MIT License
- */
-
-( function( window, factory ) {
- // universal module definition
- if ( true && module.exports ) {
- // CommonJS
- module.exports = factory( window, __webpack_require__(/*! ev-emitter */ "./node_modules/ev-emitter/ev-emitter.js") );
- } else {
- // browser global
- window.imagesLoaded = factory( window, window.EvEmitter );
- }
-
-} )( typeof window !== 'undefined' ? window : this,
- function factory( window, EvEmitter ) {
-
-let $ = window.jQuery;
-let console = window.console;
-
-// -------------------------- helpers -------------------------- //
-
-// turn element or nodeList into an array
-function makeArray( obj ) {
- // use object if already an array
- if ( Array.isArray( obj ) ) return obj;
-
- let isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
- // convert nodeList to array
- if ( isArrayLike ) return [ ...obj ];
-
- // array of single index
- return [ obj ];
-}
-
-// -------------------------- imagesLoaded -------------------------- //
-
-/**
- * @param {[Array, Element, NodeList, String]} elem
- * @param {[Object, Function]} options - if function, use as callback
- * @param {Function} onAlways - callback function
- * @returns {ImagesLoaded}
- */
-function ImagesLoaded( elem, options, onAlways ) {
- // coerce ImagesLoaded() without new, to be new ImagesLoaded()
- if ( !( this instanceof ImagesLoaded ) ) {
- return new ImagesLoaded( elem, options, onAlways );
- }
- // use elem as selector string
- let queryElem = elem;
- if ( typeof elem == 'string' ) {
- queryElem = document.querySelectorAll( elem );
- }
- // bail if bad element
- if ( !queryElem ) {
- console.error(`Bad element for imagesLoaded ${queryElem || elem}`);
- return;
- }
-
- this.elements = makeArray( queryElem );
- this.options = {};
- // shift arguments if no options set
- if ( typeof options == 'function' ) {
- onAlways = options;
- } else {
- Object.assign( this.options, options );
- }
-
- if ( onAlways ) this.on( 'always', onAlways );
-
- this.getImages();
- // add jQuery Deferred object
- if ( $ ) this.jqDeferred = new $.Deferred();
-
- // HACK check async to allow time to bind listeners
- setTimeout( this.check.bind( this ) );
-}
-
-ImagesLoaded.prototype = Object.create( EvEmitter.prototype );
-
-ImagesLoaded.prototype.getImages = function() {
- this.images = [];
-
- // filter & find items if we have an item selector
- this.elements.forEach( this.addElementImages, this );
-};
-
-const elementNodeTypes = [ 1, 9, 11 ];
-
-/**
- * @param {Node} elem
- */
-ImagesLoaded.prototype.addElementImages = function( elem ) {
- // filter siblings
- if ( elem.nodeName === 'IMG' ) {
- this.addImage( elem );
- }
- // get background image on element
- if ( this.options.background === true ) {
- this.addElementBackgroundImages( elem );
- }
-
- // find children
- // no non-element nodes, #143
- let { nodeType } = elem;
- if ( !nodeType || !elementNodeTypes.includes( nodeType ) ) return;
-
- let childImgs = elem.querySelectorAll('img');
- // concat childElems to filterFound array
- for ( let img of childImgs ) {
- this.addImage( img );
- }
-
- // get child background images
- if ( typeof this.options.background == 'string' ) {
- let children = elem.querySelectorAll( this.options.background );
- for ( let child of children ) {
- this.addElementBackgroundImages( child );
- }
- }
-};
-
-const reURL = /url\((['"])?(.*?)\1\)/gi;
-
-ImagesLoaded.prototype.addElementBackgroundImages = function( elem ) {
- let style = getComputedStyle( elem );
- // Firefox returns null if in a hidden iframe https://bugzil.la/548397
- if ( !style ) return;
-
- // get url inside url("...")
- let matches = reURL.exec( style.backgroundImage );
- while ( matches !== null ) {
- let url = matches && matches[2];
- if ( url ) {
- this.addBackground( url, elem );
- }
- matches = reURL.exec( style.backgroundImage );
- }
-};
-
-/**
- * @param {Image} img
- */
-ImagesLoaded.prototype.addImage = function( img ) {
- let loadingImage = new LoadingImage( img );
- this.images.push( loadingImage );
-};
-
-ImagesLoaded.prototype.addBackground = function( url, elem ) {
- let background = new Background( url, elem );
- this.images.push( background );
-};
-
-ImagesLoaded.prototype.check = function() {
- this.progressedCount = 0;
- this.hasAnyBroken = false;
- // complete if no images
- if ( !this.images.length ) {
- this.complete();
- return;
- }
-
- /* eslint-disable-next-line func-style */
- let onProgress = ( image, elem, message ) => {
- // HACK - Chrome triggers event before object properties have changed. #83
- setTimeout( () => {
- this.progress( image, elem, message );
- } );
- };
-
- this.images.forEach( function( loadingImage ) {
- loadingImage.once( 'progress', onProgress );
- loadingImage.check();
- } );
-};
-
-ImagesLoaded.prototype.progress = function( image, elem, message ) {
- this.progressedCount++;
- this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;
- // progress event
- this.emitEvent( 'progress', [ this, image, elem ] );
- if ( this.jqDeferred && this.jqDeferred.notify ) {
- this.jqDeferred.notify( this, image );
- }
- // check if completed
- if ( this.progressedCount === this.images.length ) {
- this.complete();
- }
-
- if ( this.options.debug && console ) {
- console.log( `progress: ${message}`, image, elem );
- }
-};
-
-ImagesLoaded.prototype.complete = function() {
- let eventName = this.hasAnyBroken ? 'fail' : 'done';
- this.isComplete = true;
- this.emitEvent( eventName, [ this ] );
- this.emitEvent( 'always', [ this ] );
- if ( this.jqDeferred ) {
- let jqMethod = this.hasAnyBroken ? 'reject' : 'resolve';
- this.jqDeferred[ jqMethod ]( this );
- }
-};
-
-// -------------------------- -------------------------- //
-
-function LoadingImage( img ) {
- this.img = img;
-}
-
-LoadingImage.prototype = Object.create( EvEmitter.prototype );
-
-LoadingImage.prototype.check = function() {
- // If complete is true and browser supports natural sizes,
- // try to check for image status manually.
- let isComplete = this.getIsImageComplete();
- if ( isComplete ) {
- // report based on naturalWidth
- this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
- return;
- }
-
- // If none of the checks above matched, simulate loading on detached element.
- this.proxyImage = new Image();
- // add crossOrigin attribute. #204
- if ( this.img.crossOrigin ) {
- this.proxyImage.crossOrigin = this.img.crossOrigin;
- }
- this.proxyImage.addEventListener( 'load', this );
- this.proxyImage.addEventListener( 'error', this );
- // bind to image as well for Firefox. #191
- this.img.addEventListener( 'load', this );
- this.img.addEventListener( 'error', this );
- this.proxyImage.src = this.img.currentSrc || this.img.src;
-};
-
-LoadingImage.prototype.getIsImageComplete = function() {
- // check for non-zero, non-undefined naturalWidth
- // fixes Safari+InfiniteScroll+Masonry bug infinite-scroll#671
- return this.img.complete && this.img.naturalWidth;
-};
-
-LoadingImage.prototype.confirm = function( isLoaded, message ) {
- this.isLoaded = isLoaded;
- let { parentNode } = this.img;
- // emit progress with parent
- )}
-
- );
-
- export default Component;
- ```
-
- ## Plain children
-
- You can pass any element to the ``, and it will handle creating the
- wrapping DOM element. Add a handler to the `onChange` method, and control the
- state in your own component. Any extra props you add to `` will be
- passed to the HTML element, allowing you set the `className`, `style`, etc.
-
- ```jsx
- import { InView } from 'react-intersection-observer';
-
- const Component = () => (
- console.log('Inview:', inView)}>
- Plain children are always rendered. Use onChange to monitor state.
-
- );
-
- export default Component;
- ```
- */
-
-
-class InView extends react__WEBPACK_IMPORTED_MODULE_0__.Component {
- constructor(props) {
- super(props);
- this.node = null;
- this._unobserveCb = null;
-
- this.handleNode = node => {
- if (this.node) {
- // Clear the old observer, before we start observing a new element
- this.unobserve();
-
- if (!node && !this.props.triggerOnce && !this.props.skip) {
- // Reset the state if we get a new node, and we aren't ignoring updates
- this.setState({
- inView: !!this.props.initialInView,
- entry: undefined
- });
- }
- }
-
- this.node = node ? node : null;
- this.observeNode();
- };
-
- this.handleChange = (inView, entry) => {
- if (inView && this.props.triggerOnce) {
- // If `triggerOnce` is true, we should stop observing the element.
- this.unobserve();
- }
-
- if (!isPlainChildren(this.props)) {
- // Store the current State, so we can pass it to the children in the next render update
- // There's no reason to update the state for plain children, since it's not used in the rendering.
- this.setState({
- inView,
- entry
- });
- }
-
- if (this.props.onChange) {
- // If the user is actively listening for onChange, always trigger it
- this.props.onChange(inView, entry);
- }
- };
-
- this.state = {
- inView: !!props.initialInView,
- entry: undefined
- };
- }
-
- componentDidUpdate(prevProps) {
- // If a IntersectionObserver option changed, reinit the observer
- if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {
- this.unobserve();
- this.observeNode();
- }
- }
-
- componentWillUnmount() {
- this.unobserve();
- this.node = null;
- }
-
- observeNode() {
- if (!this.node || this.props.skip) return;
- const {
- threshold,
- root,
- rootMargin,
- trackVisibility,
- delay,
- fallbackInView
- } = this.props;
- this._unobserveCb = observe(this.node, this.handleChange, {
- threshold,
- root,
- rootMargin,
- // @ts-ignore
- trackVisibility,
- // @ts-ignore
- delay
- }, fallbackInView);
- }
-
- unobserve() {
- if (this._unobserveCb) {
- this._unobserveCb();
-
- this._unobserveCb = null;
- }
- }
-
- render() {
- if (!isPlainChildren(this.props)) {
- const {
- inView,
- entry
- } = this.state;
- return this.props.children({
- inView,
- entry,
- ref: this.handleNode
- });
- }
-
- const _this$props = this.props,
- {
- children,
- as
- } = _this$props,
- props = _objectWithoutPropertiesLoose(_this$props, _excluded);
-
- return react__WEBPACK_IMPORTED_MODULE_0__.createElement(as || 'div', _extends({
- ref: this.handleNode
- }, props), children);
- }
-
-}
-
-/**
- * React Hooks make it easy to monitor the `inView` state of your components. Call
- * the `useInView` hook with the (optional) [options](#options) you need. It will
- * return an array containing a `ref`, the `inView` status and the current
- * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry).
- * Assign the `ref` to the DOM element you want to monitor, and the hook will
- * report the status.
- *
- * @example
- * ```jsx
- * import React from 'react';
- * import { useInView } from 'react-intersection-observer';
- *
- * const Component = () => {
- * const { ref, inView, entry } = useInView({
- * threshold: 0,
- * });
- *
- * return (
- *
- *
{`Header inside viewport ${inView}.`}
- *
- * );
- * };
- * ```
- */
-
-function useInView({
- threshold,
- delay,
- trackVisibility,
- rootMargin,
- root,
- triggerOnce,
- skip,
- initialInView,
- fallbackInView,
- onChange
-} = {}) {
- var _state$entry;
-
- const [ref, setRef] = react__WEBPACK_IMPORTED_MODULE_0__.useState(null);
- const callback = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
- const [state, setState] = react__WEBPACK_IMPORTED_MODULE_0__.useState({
- inView: !!initialInView,
- entry: undefined
- }); // Store the onChange callback in a `ref`, so we can access the latest instance
- // inside the `useEffect`, but without triggering a rerender.
-
- callback.current = onChange;
- react__WEBPACK_IMPORTED_MODULE_0__.useEffect(() => {
- // Ensure we have node ref, and that we shouldn't skip observing
- if (skip || !ref) return;
- let unobserve;
- unobserve = observe(ref, (inView, entry) => {
- setState({
- inView,
- entry
- });
- if (callback.current) callback.current(inView, entry);
-
- if (entry.isIntersecting && triggerOnce && unobserve) {
- // If it should only trigger once, unobserve the element after it's inView
- unobserve();
- unobserve = undefined;
- }
- }, {
- root,
- rootMargin,
- threshold,
- // @ts-ignore
- trackVisibility,
- // @ts-ignore
- delay
- }, fallbackInView);
- return () => {
- if (unobserve) {
- unobserve();
- }
- };
- }, // We break the rule here, because we aren't including the actual `threshold` variable
- // eslint-disable-next-line react-hooks/exhaustive-deps
- [// If the threshold is an array, convert it to a string, so it won't change between renders.
- // eslint-disable-next-line react-hooks/exhaustive-deps
- Array.isArray(threshold) ? threshold.toString() : threshold, ref, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]);
- const entryTarget = (_state$entry = state.entry) == null ? void 0 : _state$entry.target;
- const previousEntryTarget = react__WEBPACK_IMPORTED_MODULE_0__.useRef();
-
- if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {
- // If we don't have a node ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`)
- // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView
- previousEntryTarget.current = entryTarget;
- setState({
- inView: !!initialInView,
- entry: undefined
- });
- }
-
- const result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values.
-
- result.ref = result[0];
- result.inView = result[1];
- result.entry = result[2];
- return result;
-}
-
-
-//# sourceMappingURL=react-intersection-observer.modern.mjs.map
-
-
-/***/ })
-
-/******/ });
-/************************************************************************/
-/******/ // The module cache
-/******/ var __webpack_module_cache__ = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/ // Check if module is in cache
-/******/ var cachedModule = __webpack_module_cache__[moduleId];
-/******/ if (cachedModule !== undefined) {
-/******/ return cachedModule.exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = __webpack_module_cache__[moduleId] = {
-/******/ // no module.id needed
-/******/ // no module.loaded needed
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = __webpack_modules__;
-/******/
-/************************************************************************/
-/******/ /* webpack/runtime/chunk loaded */
-/******/ (() => {
-/******/ var deferred = [];
-/******/ __webpack_require__.O = (result, chunkIds, fn, priority) => {
-/******/ if(chunkIds) {
-/******/ priority = priority || 0;
-/******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
-/******/ deferred[i] = [chunkIds, fn, priority];
-/******/ return;
-/******/ }
-/******/ var notFulfilled = Infinity;
-/******/ for (var i = 0; i < deferred.length; i++) {
-/******/ var chunkIds = deferred[i][0];
-/******/ var fn = deferred[i][1];
-/******/ var priority = deferred[i][2];
-/******/ var fulfilled = true;
-/******/ for (var j = 0; j < chunkIds.length; j++) {
-/******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {
-/******/ chunkIds.splice(j--, 1);
-/******/ } else {
-/******/ fulfilled = false;
-/******/ if(priority < notFulfilled) notFulfilled = priority;
-/******/ }
-/******/ }
-/******/ if(fulfilled) {
-/******/ deferred.splice(i--, 1)
-/******/ var r = fn();
-/******/ if (r !== undefined) result = r;
-/******/ }
-/******/ }
-/******/ return result;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/compat get default export */
-/******/ (() => {
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = (module) => {
-/******/ var getter = module && module.__esModule ?
-/******/ () => (module['default']) :
-/******/ () => (module);
-/******/ __webpack_require__.d(getter, { a: getter });
-/******/ return getter;
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/define property getters */
-/******/ (() => {
-/******/ // define getter functions for harmony exports
-/******/ __webpack_require__.d = (exports, definition) => {
-/******/ for(var key in definition) {
-/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
-/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
-/******/ }
-/******/ }
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/global */
-/******/ (() => {
-/******/ __webpack_require__.g = (function() {
-/******/ if (typeof globalThis === 'object') return globalThis;
-/******/ try {
-/******/ return this || new Function('return this')();
-/******/ } catch (e) {
-/******/ if (typeof window === 'object') return window;
-/******/ }
-/******/ })();
-/******/ })();
-/******/
-/******/ /* webpack/runtime/hasOwnProperty shorthand */
-/******/ (() => {
-/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
-/******/ })();
-/******/
-/******/ /* webpack/runtime/make namespace object */
-/******/ (() => {
-/******/ // define __esModule on exports
-/******/ __webpack_require__.r = (exports) => {
-/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ }
-/******/ Object.defineProperty(exports, '__esModule', { value: true });
-/******/ };
-/******/ })();
-/******/
-/******/ /* webpack/runtime/jsonp chunk loading */
-/******/ (() => {
-/******/ // no baseURI
-/******/
-/******/ // object to store loaded and loading chunks
-/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
-/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
-/******/ var installedChunks = {
-/******/ "instant-images": 0,
-/******/ "./style-instant-images": 0
-/******/ };
-/******/
-/******/ // no chunk on demand loading
-/******/
-/******/ // no prefetching
-/******/
-/******/ // no preloaded
-/******/
-/******/ // no HMR
-/******/
-/******/ // no HMR manifest
-/******/
-/******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);
-/******/
-/******/ // install a JSONP callback for chunk loading
-/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
-/******/ var chunkIds = data[0];
-/******/ var moreModules = data[1];
-/******/ var runtime = data[2];
-/******/ // add "moreModules" to the modules object,
-/******/ // then flag all "chunkIds" as loaded and fire callback
-/******/ var moduleId, chunkId, i = 0;
-/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
-/******/ for(moduleId in moreModules) {
-/******/ if(__webpack_require__.o(moreModules, moduleId)) {
-/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
-/******/ }
-/******/ }
-/******/ if(runtime) var result = runtime(__webpack_require__);
-/******/ }
-/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
-/******/ for(;i < chunkIds.length; i++) {
-/******/ chunkId = chunkIds[i];
-/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
-/******/ installedChunks[chunkId][0]();
-/******/ }
-/******/ installedChunks[chunkId] = 0;
-/******/ }
-/******/ return __webpack_require__.O(result);
-/******/ }
-/******/
-/******/ var chunkLoadingGlobal = self["webpackChunkinstant_images"] = self["webpackChunkinstant_images"] || [];
-/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
-/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
-/******/ })();
-/******/
-/************************************************************************/
-/******/
-/******/ // startup
-/******/ // Load entry module and return exports
-/******/ // This entry module depends on other loaded chunks and execution need to be delayed
-/******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["./style-instant-images"], () => (__webpack_require__("./src/js/index.js")))
-/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
-/******/
-/******/ })()
-;
-//# sourceMappingURL=instant-images.js.map
\ No newline at end of file
+(()=>{var t,e={7131:(t,e,n)=>{"use strict";const r=window.wp.element;function i(t,e){return function(){return t.apply(e,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:a}=Object,s=(c=Object.create(null),t=>{const e=o.call(t);return c[e]||(c[e]=e.slice(8,-1).toLowerCase())});var c;const l=t=>(t=t.toLowerCase(),e=>s(e)===t),u=t=>e=>typeof e===t,{isArray:f}=Array,h=u("undefined"),d=l("ArrayBuffer"),p=u("string"),m=u("function"),v=u("number"),g=t=>null!==t&&"object"==typeof t,y=t=>{if("object"!==s(t))return!1;const e=a(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},_=l("Date"),b=l("File"),w=l("Blob"),E=l("FileList"),S=l("URLSearchParams");function R(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,i;if("object"!=typeof t&&(t=[t]),f(t))for(r=0,i=t.length;r0;)if(r=n[i],e===r.toLowerCase())return r;return null}const k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,O=t=>!h(t)&&t!==k,C=(A="undefined"!=typeof Uint8Array&&a(Uint8Array),t=>A&&t instanceof A);var A;const L=l("HTMLFormElement"),B=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),j=l("RegExp"),N=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};R(n,((n,i)=>{!1!==e(n,i,t)&&(r[i]=n)})),Object.defineProperties(t,r)},P="abcdefghijklmnopqrstuvwxyz",z="0123456789",T={DIGIT:z,ALPHA:P,ALPHA_DIGIT:P+P.toUpperCase()+z},I={isArray:f,isArrayBuffer:d,isBuffer:function(t){return null!==t&&!h(t)&&null!==t.constructor&&!h(t.constructor)&&m(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{const e="[object FormData]";return t&&("function"==typeof FormData&&t instanceof FormData||o.call(t)===e||m(t.toString)&&t.toString()===e)},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&d(t.buffer),e},isString:p,isNumber:v,isBoolean:t=>!0===t||!1===t,isObject:g,isPlainObject:y,isUndefined:h,isDate:_,isFile:b,isBlob:w,isRegExp:j,isFunction:m,isStream:t=>g(t)&&m(t.pipe),isURLSearchParams:S,isTypedArray:C,isFileList:E,forEach:R,merge:function t(){const{caseless:e}=O(this)&&this||{},n={},r=(r,i)=>{const o=e&&x(n,i)||i;y(n[o])&&y(r)?n[o]=t(n[o],r):y(r)?n[o]=t({},r):f(r)?n[o]=r.slice():n[o]=r};for(let t=0,e=arguments.length;t(R(e,((e,r)=>{n&&m(e)?t[r]=i(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let i,o,s;const c={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),o=i.length;o-- >0;)s=i[o],r&&!r(s,t,e)||c[s]||(e[s]=t[s],c[s]=!0);t=!1!==n&&a(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:s,kindOfTest:l,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(f(t))return t;let e=t.length;if(!v(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:L,hasOwnProperty:B,hasOwnProp:B,reduceDescriptors:N,freezeMethods:t=>{N(t,((e,n)=>{if(m(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];m(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return f(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:x,global:k,isContextDefined:O,ALPHABET:T,generateString:(t=16,e=T.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&m(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(g(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const i=f(t)?[]:{};return R(t,((t,e)=>{const o=n(t,r+1);!h(o)&&(i[e]=o)})),e[r]=void 0,i}}return t};return n(t,0)}};function D(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}I.inherits(D,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const M=D.prototype,F={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{F[t]={value:t}})),Object.defineProperties(D,F),Object.defineProperty(M,"isAxiosError",{value:!0}),D.from=(t,e,n,r,i,o)=>{const a=Object.create(M);return I.toFlatObject(t,a,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),D.call(a,t.message,e,n,r,i),a.cause=t,a.name=t.name,o&&Object.assign(a,o),a};const H=D;function W(t){return I.isPlainObject(t)||I.isArray(t)}function U(t){return I.endsWith(t,"[]")?t.slice(0,-2):t}function q(t,e,n){return t?t.concat(e).map((function(t,e){return t=U(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const V=I.toFlatObject(I,{},null,(function(t){return/^is[A-Z]/.test(t)})),G=function(t,e,n){if(!I.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=I.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!I.isUndefined(e[t])}))).metaTokens,i=n.visitor||l,o=n.dots,a=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&I.isSpecCompliantForm(e);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(I.isDate(t))return t.toISOString();if(!s&&I.isBlob(t))throw new H("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(t)||I.isTypedArray(t)?s&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function l(t,n,i){let s=t;if(t&&!i&&"object"==typeof t)if(I.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(I.isArray(t)&&function(t){return I.isArray(t)&&!t.some(W)}(t)||(I.isFileList(t)||I.endsWith(n,"[]"))&&(s=I.toArray(t)))return n=U(n),s.forEach((function(t,r){!I.isUndefined(t)&&null!==t&&e.append(!0===a?q([n],r,o):null===a?n:n+"[]",c(t))})),!1;return!!W(t)||(e.append(q(i,n,o),c(t)),!1)}const u=[],f=Object.assign(V,{defaultVisitor:l,convertValue:c,isVisitable:W});if(!I.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!I.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),I.forEach(n,(function(n,o){!0===(!(I.isUndefined(n)||null===n)&&i.call(e,n,I.isString(o)?o.trim():o,r,f))&&t(n,r?r.concat(o):[o])})),u.pop()}}(t),e};function Y(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function J(t,e){this._pairs=[],t&&G(t,this,e)}const K=J.prototype;K.append=function(t,e){this._pairs.push([t,e])},K.toString=function(t){const e=t?function(e){return t.call(this,e,Y)}:Y;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const X=J;function $(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Z(t,e,n){if(!e)return t;const r=n&&n.encode||$,i=n&&n.serialize;let o;if(o=i?i(e,n):I.isURLSearchParams(e)?e.toString():new X(e,n).toString(r),o){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+o}return t}const Q=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){I.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},tt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},et={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let t;return("undefined"==typeof navigator||"ReactNative"!==(t=navigator.product)&&"NativeScript"!==t&&"NS"!==t)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]},nt=function(t){function e(t,n,r,i){let o=t[i++];const a=Number.isFinite(+o),s=i>=t.length;return o=!o&&I.isArray(r)?r.length:o,s?(I.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!a):(r[o]&&I.isObject(r[o])||(r[o]=[]),e(t,n,r[o],i)&&I.isArray(r[o])&&(r[o]=function(t){const e={},n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r{e(function(t){return I.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null},rt={"Content-Type":void 0},it={transitional:tt,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,i=I.isObject(t);if(i&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return r&&r?JSON.stringify(nt(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return G(t,new et.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return et.isNode&&I.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((o=I.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return G(o?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||r?(e.setContentType("application/json",!1),function(t,e,n){if(I.isString(t))try{return(0,JSON.parse)(t),I.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||it.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(t&&I.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw H.from(t,H.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:et.classes.FormData,Blob:et.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};I.forEach(["delete","get","head"],(function(t){it.headers[t]={}})),I.forEach(["post","put","patch"],(function(t){it.headers[t]=I.merge(rt)}));const ot=it,at=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),st=Symbol("internals");function ct(t){return t&&String(t).trim().toLowerCase()}function lt(t){return!1===t||null==t?t:I.isArray(t)?t.map(lt):String(t)}function ut(t,e,n,r,i){return I.isFunction(r)?r.call(this,e,n):(i&&(e=n),I.isString(e)?I.isString(r)?-1!==e.indexOf(r):I.isRegExp(r)?r.test(e):void 0:void 0)}class ft{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function i(t,e,n){const i=ct(e);if(!i)throw new Error("header name must be a non-empty string");const o=I.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||e]=lt(t))}const o=(t,e)=>I.forEach(t,((t,n)=>i(t,n,e)));return I.isPlainObject(t)||t instanceof this.constructor?o(t,e):I.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z]+$/.test(t.trim())?o((t=>{const e={};let n,r,i;return t&&t.split("\n").forEach((function(t){i=t.indexOf(":"),n=t.substring(0,i).trim().toLowerCase(),r=t.substring(i+1).trim(),!n||e[n]&&at[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e):null!=t&&i(e,t,n),this}get(t,e){if(t=ct(t)){const n=I.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(I.isFunction(e))return e.call(this,t,n);if(I.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ct(t)){const n=I.findKey(this,t);return!(!n||void 0===this[n]||e&&!ut(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function i(t){if(t=ct(t)){const i=I.findKey(n,t);!i||e&&!ut(0,n[i],i,e)||(delete n[i],r=!0)}}return I.isArray(t)?t.forEach(i):i(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const i=e[n];t&&!ut(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}normalize(t){const e=this,n={};return I.forEach(this,((r,i)=>{const o=I.findKey(n,i);if(o)return e[o]=lt(r),void delete e[i];const a=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(i):String(i).trim();a!==i&&delete e[i],e[a]=lt(r),n[a]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return I.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&I.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[st]=this[st]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=ct(t);e[r]||(function(t,e){const n=I.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[r]=!0)}return I.isArray(t)?t.forEach(r):r(t),this}}ft.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.freezeMethods(ft.prototype),I.freezeMethods(ft);const ht=ft;function dt(t,e){const n=this||ot,r=e||n,i=ht.from(r.headers);let o=r.data;return I.forEach(t,(function(t){o=t.call(n,o,i.normalize(),e?e.status:void 0)})),i.normalize(),o}function pt(t){return!(!t||!t.__CANCEL__)}function mt(t,e,n){H.call(this,null==t?"canceled":t,H.ERR_CANCELED,e,n),this.name="CanceledError"}I.inherits(mt,H,{__CANCEL__:!0});const vt=mt,gt=et.isStandardBrowserEnv?{write:function(t,e,n,r,i,o){const a=[];a.push(t+"="+encodeURIComponent(e)),I.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),I.isString(r)&&a.push("path="+r),I.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function yt(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const _t=et.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function r(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=r(window.location.href),function(t){const e=I.isString(t)?r(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return!0},bt=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i,o=0,a=0;return e=void 0!==e?e:1e3,function(s){const c=Date.now(),l=r[a];i||(i=c),n[o]=s,r[o]=c;let u=a,f=0;for(;u!==o;)f+=n[u++],u%=t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),c-i{const o=i.loaded,a=i.lengthComputable?i.total:void 0,s=o-n,c=r(s);n=o;const l={loaded:o,total:a,progress:a?o/a:void 0,bytes:s,rate:c||void 0,estimated:c&&a&&o<=a?(a-o)/c:void 0,event:i};l[e?"download":"upload"]=!0,t(l)}}const Et={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){let r=t.data;const i=ht.from(t.headers).normalize(),o=t.responseType;let a;function s(){t.cancelToken&&t.cancelToken.unsubscribe(a),t.signal&&t.signal.removeEventListener("abort",a)}I.isFormData(r)&&(et.isStandardBrowserEnv||et.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);let c=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",n=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(e+":"+n))}const l=yt(t.baseURL,t.url);function u(){if(!c)return;const r=ht.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new H("Request failed with status code "+n.status,[H.ERR_BAD_REQUEST,H.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}((function(t){e(t),s()}),(function(t){n(t),s()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:t,request:c}),c=null}if(c.open(t.method.toUpperCase(),Z(l,t.params,t.paramsSerializer),!0),c.timeout=t.timeout,"onloadend"in c?c.onloadend=u:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(u)},c.onabort=function(){c&&(n(new H("Request aborted",H.ECONNABORTED,t,c)),c=null)},c.onerror=function(){n(new H("Network Error",H.ERR_NETWORK,t,c)),c=null},c.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||tt;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new H(e,r.clarifyTimeoutError?H.ETIMEDOUT:H.ECONNABORTED,t,c)),c=null},et.isStandardBrowserEnv){const e=(t.withCredentials||_t(l))&&t.xsrfCookieName&>.read(t.xsrfCookieName);e&&i.set(t.xsrfHeaderName,e)}void 0===r&&i.setContentType(null),"setRequestHeader"in c&&I.forEach(i.toJSON(),(function(t,e){c.setRequestHeader(e,t)})),I.isUndefined(t.withCredentials)||(c.withCredentials=!!t.withCredentials),o&&"json"!==o&&(c.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&c.addEventListener("progress",wt(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",wt(t.onUploadProgress)),(t.cancelToken||t.signal)&&(a=e=>{c&&(n(!e||e.type?new vt(null,t,c):e),c.abort(),c=null)},t.cancelToken&&t.cancelToken.subscribe(a),t.signal&&(t.signal.aborted?a():t.signal.addEventListener("abort",a)));const f=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(l);f&&-1===et.protocols.indexOf(f)?n(new H("Unsupported protocol "+f+":",H.ERR_BAD_REQUEST,t)):c.send(r||null)}))}};I.forEach(Et,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const St={getAdapter:t=>{t=I.isArray(t)?t:[t];const{length:e}=t;let n,r;for(let i=0;it instanceof ht?t.toJSON():t;function Ot(t,e){e=e||{};const n={};function r(t,e,n){return I.isPlainObject(t)&&I.isPlainObject(e)?I.merge.call({caseless:n},t,e):I.isPlainObject(e)?I.merge({},e):I.isArray(e)?e.slice():e}function i(t,e,n){return I.isUndefined(e)?I.isUndefined(t)?void 0:r(void 0,t,n):r(t,e,n)}function o(t,e){if(!I.isUndefined(e))return r(void 0,e)}function a(t,e){return I.isUndefined(e)?I.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function s(n,i,o){return o in e?r(n,i):o in t?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(t,e)=>i(kt(t),kt(e),!0)};return I.forEach(Object.keys(t).concat(Object.keys(e)),(function(r){const o=c[r]||i,a=o(t[r],e[r],r);I.isUndefined(a)&&o!==s||(n[r]=a)})),n}const Ct={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Ct[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const At={};Ct.transitional=function(t,e,n){function r(t,e){return"[Axios v1.3.4] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,i,o)=>{if(!1===t)throw new H(r(i," has been removed"+(e?" in "+e:"")),H.ERR_DEPRECATED);return e&&!At[i]&&(At[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,o)}};const Lt={assertOptions:function(t,e,n){if("object"!=typeof t)throw new H("options must be an object",H.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const o=r[i],a=e[o];if(a){const e=t[o],n=void 0===e||a(e,o,t);if(!0!==n)throw new H("option "+o+" must be "+n,H.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new H("Unknown option "+o,H.ERR_BAD_OPTION)}},validators:Ct},Bt=Lt.validators;class jt{constructor(t){this.defaults=t,this.interceptors={request:new Q,response:new Q}}request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Ot(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:i}=e;let o;void 0!==n&&Lt.assertOptions(n,{silentJSONParsing:Bt.transitional(Bt.boolean),forcedJSONParsing:Bt.transitional(Bt.boolean),clarifyTimeoutError:Bt.transitional(Bt.boolean)},!1),void 0!==r&&Lt.assertOptions(r,{encode:Bt.function,serialize:Bt.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase(),o=i&&I.merge(i.common,i[e.method]),o&&I.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete i[t]})),e.headers=ht.concat(o,i);const a=[];let s=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(s=s&&t.synchronous,a.unshift(t.fulfilled,t.rejected))}));const c=[];let l;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let u,f=0;if(!s){const t=[xt.bind(this),void 0];for(t.unshift.apply(t,a),t.push.apply(t,c),u=t.length,l=Promise.resolve(e);f{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,i){n.reason||(n.reason=new vt(t,r,i),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new Pt((function(e){t=e})),cancel:t}}}const zt=Pt,Tt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Tt).forEach((([t,e])=>{Tt[e]=t}));const It=Tt,Dt=function t(e){const n=new Nt(e),r=i(Nt.prototype.request,n);return I.extend(r,Nt.prototype,n,{allOwnKeys:!0}),I.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(Ot(e,n))},r}(ot);Dt.Axios=Nt,Dt.CanceledError=vt,Dt.CancelToken=zt,Dt.isCancel=pt,Dt.VERSION="1.3.4",Dt.toFormData=G,Dt.AxiosError=H,Dt.Cancel=Dt.CanceledError,Dt.all=function(t){return Promise.all(t)},Dt.spread=function(t){return function(e){return t.apply(null,e)}},Dt.isAxiosError=function(t){return I.isObject(t)&&!0===t.isAxiosError},Dt.mergeConfig=Ot,Dt.AxiosHeaders=ht,Dt.formToJSON=t=>nt(I.isHTMLForm(t)?new FormData(t):t),Dt.HttpStatusCode=It,Dt.default=Dt;const Mt=Dt;var Ft=n(4184),Ht=n.n(Ft),Wt=n(8751),Ut=n.n(Wt);const qt=window.React,Vt=new Map,Gt=new WeakMap;let Yt=0;function Jt(t,e,n={},r=undefined){if(void 0===window.IntersectionObserver&&void 0!==r){const i=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:o,elements:a}=function(t){let e=function(t){return Object.keys(t).sort().filter((e=>void 0!==t[e])).map((e=>{return`${e}_${"root"===e?(n=t.root,n?(Gt.has(n)||(Yt+=1,Gt.set(n,Yt.toString())),Gt.get(n)):"0"):t[e]}`;var n})).toString()}(t),n=Vt.get(e);if(!n){const r=new Map;let i;const o=new IntersectionObserver((e=>{e.forEach((e=>{var n;const o=e.isIntersecting&&i.some((t=>e.intersectionRatio>=t));t.trackVisibility&&void 0===e.isVisible&&(e.isVisible=o),null==(n=r.get(e.target))||n.forEach((t=>{t(o,e)}))}))}),t);i=o.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:o,elements:r},Vt.set(e,n)}return n}(n);let s=a.get(t)||[];return a.has(t)||a.set(t,s),s.push(e),o.observe(t),function(){s.splice(s.indexOf(e),1),0===s.length&&(a.delete(t),o.unobserve(t)),0===a.size&&(o.disconnect(),Vt.delete(i))}}class Kt extends qt.Component{constructor(t){super(t),this.node=null,this._unobserveCb=null,this.handleNode=t=>{this.node&&(this.unobserve(),t||this.props.triggerOnce||this.props.skip||this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=t||null,this.observeNode()},this.handleChange=(t,e)=>{t&&this.props.triggerOnce&&this.unobserve(),isPlainChildren(this.props)||this.setState({inView:t,entry:e}),this.props.onChange&&this.props.onChange(t,e)},this.state={inView:!!t.initialInView,entry:void 0}}componentDidUpdate(t){t.rootMargin===this.props.rootMargin&&t.root===this.props.root&&t.threshold===this.props.threshold&&t.skip===this.props.skip&&t.trackVisibility===this.props.trackVisibility&&t.delay===this.props.delay||(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve(),this.node=null}observeNode(){if(!this.node||this.props.skip)return;const{threshold:t,root:e,rootMargin:n,trackVisibility:r,delay:i,fallbackInView:o}=this.props;this._unobserveCb=Jt(this.node,this.handleChange,{threshold:t,root:e,rootMargin:n,trackVisibility:r,delay:i},o)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){if(!isPlainChildren(this.props)){const{inView:t,entry:e}=this.state;return this.props.children({inView:t,entry:e,ref:this.handleNode})}const t=this.props,{children:e,as:n}=t,r=function(t,e){if(null==t)return{};for(var n,r,i={},o=Object.keys(t);r=0||(i[n]=t[n]);return i}(t);return React.createElement(n||"div",_extends({ref:this.handleNode},r),e)}}function Xt({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:i,triggerOnce:o,skip:a,initialInView:s,fallbackInView:c,onChange:l}={}){var u;const[f,h]=qt.useState(null),d=qt.useRef(),[p,m]=qt.useState({inView:!!s,entry:void 0});d.current=l,qt.useEffect((()=>{if(a||!f)return;let s;return s=Jt(f,((t,e)=>{m({inView:t,entry:e}),d.current&&d.current(t,e),e.isIntersecting&&o&&s&&(s(),s=void 0)}),{root:i,rootMargin:r,threshold:t,trackVisibility:n,delay:e},c),()=>{s&&s()}}),[Array.isArray(t)?t.toString():t,f,i,r,o,a,n,c,e]);const v=null==(u=p.entry)?void 0:u.target,g=qt.useRef();f||!v||o||a||g.current===v||(g.current=v,m({inView:!!s,entry:void 0}));const y=[h,p.inView,p.entry];return y.ref=y[0],y.inView=y[1],y.entry=y[2],y}var $t=(0,r.createContext)();function Zt(t){var e=t.value,n=t.children;return React.createElement($t.Provider,{value:e},n)}function Qt(){return(0,r.useContext)($t)}function te(t){return t&&ee[t.toLowerCase()].icon?ee[t.toLowerCase()].icon():null}var ee={proxy:"https://proxy.getinstantimages.com/api/",testmode:!1,defaults:{provider:"unsplash",order:"latest",per_page:"20",arr_key:"results"},providers:["Unsplash","Openverse","Pixabay","Pexels"],unsplash:{name:"Unsplash",requires_key:!0,new:!1,api_var:"client_id",collections_api:"https://api.unsplash.com/collections/",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M10 9V0H22V9H10ZM22 14H32V32H0V14H10V23H22V14Z",fill:"black"}))}},pixabay:{name:"Pixabay",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{clipPath:"url(#clip0_307_143)"},React.createElement("path",{d:"M0 0V32H32V0H0Z",fill:"#48A947"}),React.createElement("path",{d:"M6.83734 22.3147V28C5.93067 28.0427 5.02401 28.032 4.11734 27.9787C4.09601 27.7014 4.06401 27.4667 4.06401 27.2427C4.06401 23.2427 4.05334 19.2534 4.06401 15.2534C4.07467 12.032 5.97334 9.32269 8.85334 8.37335C13.1307 6.95469 17.4507 10.048 17.8453 14.3894C18.144 17.6534 16.4267 20.5547 13.568 21.7814C12.6507 22.176 11.6907 22.304 10.7093 22.304C9.45067 22.3147 8.21334 22.3147 6.83734 22.3147ZM6.84801 19.4454C8.24534 19.4454 9.54667 19.424 10.848 19.4454C13.1627 19.488 14.816 17.76 15.104 15.712C15.424 13.3654 13.7813 11.2107 11.4453 10.88H11.4347C9.25867 10.592 7.06134 12.2774 6.88001 14.528C6.74134 16.128 6.84801 17.728 6.84801 19.4454Z",fill:"#F9FBF9"}),React.createElement("path",{d:"M25.4827 14.9334L30.656 22.2081H27.3067L23.4667 16.9494C22.0694 18.6881 20.9067 20.4907 19.584 22.2081H16.2454L21.408 14.9334L16.8107 8.04272H20.16L23.4454 12.9494L26.7307 8.04272H30.0694L25.4827 14.9334Z",fill:"#FAFCFA"}),React.createElement("path",{d:"M6.848 19.4453C6.848 17.7279 6.74134 16.1173 6.86934 14.5386C7.05067 12.2879 9.248 10.6026 11.424 10.8906C13.7707 11.2106 15.4133 13.3653 15.0933 15.7119C14.816 17.7599 13.152 19.4879 10.8373 19.4453C9.54667 19.4239 8.24534 19.4453 6.848 19.4453Z",fill:"#4AA949"})),React.createElement("defs",null,React.createElement("clipPath",{id:"clip0_307_143"},React.createElement("rect",{width:"32",height:"32",fill:"white"}))))}},pexels:{name:"Pexels",requires_key:!0,new:!1,api_var:"key",icon:function(){return React.createElement("svg",{width:"32px",height:"32px",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M2 0h28a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2z",fill:"#05A081"}),React.createElement("path",{d:"M13 21h3.863v-3.752h1.167a3.124 3.124 0 1 0 0-6.248H13v10zm5.863 2H11V9h7.03a5.124 5.124 0 0 1 .833 10.18V23z",fill:"#fff"}))}},openverse:{name:"Openverse",requires_key:!1,new:!1,api_var:"key",key:"",icon:function(){return React.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg"},React.createElement("path",{d:"M25.8578 14.32C29.6708 14.32 32.7618 11.1144 32.7618 7.16C32.7618 3.20564 29.6708 0 25.8578 0C22.0448 0 18.9539 3.20564 18.9539 7.16C18.9539 11.1144 22.0448 14.32 25.8578 14.32Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 7.16C0.761841 11.1 3.84742 14.32 7.66584 14.32V0C3.84742 0 0.761841 3.2 0.761841 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 7.16C9.85791 11.1 12.9435 14.32 16.7619 14.32V0C12.9628 0 9.85791 3.2 9.85791 7.16Z",fill:"#000000"}),React.createElement("path",{d:"M25.8578 31.9399C29.6708 31.9399 32.7618 28.7343 32.7618 24.78C32.7618 20.8256 29.6708 17.62 25.8578 17.62C22.0448 17.62 18.9539 20.8256 18.9539 24.78C18.9539 28.7343 22.0448 31.9399 25.8578 31.9399Z",fill:"#000000"}),React.createElement("path",{d:"M9.85791 24.7801C9.85791 28.72 12.9435 31.9401 16.7619 31.9401V17.64C12.9628 17.64 9.85791 20.84 9.85791 24.7801Z",fill:"#000000"}),React.createElement("path",{d:"M0.761841 24.84C0.761841 28.8 3.84742 32 7.66584 32V17.7C3.84742 17.7 0.761841 20.9 0.761841 24.84Z",fill:"#000000"}))}}};const ne=window.wp.i18n;var re=[{label:(0,ne.__)("WordPress","instant-images"),value:"wordpress"},{label:(0,ne.__)("Flickr","instant-images"),value:"flickr"},{label:(0,ne.__)("Nasa","instant-images"),value:"nasa"},{label:(0,ne.__)("SpaceX","instant-images"),value:"spacex"},{label:(0,ne.__)("Wikimedia","instant-images"),value:"wikimedia"}],ie=[{label:(0,ne.__)("Square","instant-images"),value:"square"},{label:(0,ne.__)("Tall","instant-images"),value:"tall"},{label:(0,ne.__)("Wide","instant-images"),value:"wide"}],oe=[{label:(0,ne.__)("Red","instant-images"),value:"red"},{label:(0,ne.__)("Orange","instant-images"),value:"orange"},{label:(0,ne.__)("Yellow","instant-images"),value:"yellow"},{label:(0,ne.__)("Green","instant-images"),value:"green"},{label:(0,ne.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,ne.__)("Blue","instant-images"),value:"blue"},{label:(0,ne.__)("Violet","instant-images"),value:"violet"},{label:(0,ne.__)("Pink","instant-images"),value:"pink"},{label:(0,ne.__)("Brown","instant-images"),value:"brown"},{label:(0,ne.__)("Black","instant-images"),value:"black"},{label:(0,ne.__)("Gray","instant-images"),value:"gray"},{label:(0,ne.__)("White","instant-images"),value:"white"}],ae=[{label:(0,ne.__)("Landscape","instant-images"),value:"landscape"},{label:(0,ne.__)("Portrait","instant-images"),value:"portrait"},{label:(0,ne.__)("Square","instant-images"),value:"squarish"}],se=[{label:(0,ne.__)("Grayscale","instant-images"),value:"grayscale"},{label:(0,ne.__)("Red","instant-images"),value:"red"},{label:(0,ne.__)("Orange","instant-images"),value:"orange"},{label:(0,ne.__)("Yellow","instant-images"),value:"yellow"},{label:(0,ne.__)("Green","instant-images"),value:"green"},{label:(0,ne.__)("Turquoise","instant-images"),value:"turquoise"},{label:(0,ne.__)("Blue","instant-images"),value:"blue"},{label:(0,ne.__)("Lilac","instant-images"),value:"lilac"},{label:(0,ne.__)("Pink","instant-images"),value:"pink"},{label:(0,ne.__)("White","instant-images"),value:"white"},{label:(0,ne.__)("Gray","instant-images"),value:"gray"},{label:(0,ne.__)("Black","instant-images"),value:"black"},{label:(0,ne.__)("Brown","instant-images"),value:"brown"},{label:(0,ne.__)("Transparent","instant-images"),value:"transparent"}],ce=[{label:(0,ne.__)("Backgrounds","instant-images"),value:"backgrounds"},{label:(0,ne.__)("Fashion","instant-images"),value:"fashion"},{label:(0,ne.__)("Nature","instant-images"),value:"nature"},{label:(0,ne.__)("Science","instant-images"),value:"science"},{label:(0,ne.__)("Education","instant-images"),value:"education"},{label:(0,ne.__)("Feelings","instant-images"),value:"feelings"},{label:(0,ne.__)("Health","instant-images"),value:"health"},{label:(0,ne.__)("People","instant-images"),value:"people"},{label:(0,ne.__)("Religion","instant-images"),value:"religion"},{label:(0,ne.__)("Places","instant-images"),value:"places"},{label:(0,ne.__)("Animals","instant-images"),value:"animals"},{label:(0,ne.__)("Industry","instant-images"),value:"industry"},{label:(0,ne.__)("Computer","instant-images"),value:"computer"},{label:(0,ne.__)("Food","instant-images"),value:"food"},{label:(0,ne.__)("Sports","instant-images"),value:"sports"},{label:(0,ne.__)("Food","instant-images"),value:"food"},{label:(0,ne.__)("Transportation","instant-images"),value:"transportation"},{label:(0,ne.__)("Travel","instant-images"),value:"travel"},{label:(0,ne.__)("Buildings","instant-images"),value:"buildings"},{label:(0,ne.__)("Business","instant-images"),value:"business"},{label:(0,ne.__)("Music","instant-images"),value:"music"}],le=[{label:(0,ne.__)("Horizontal","instant-images"),value:"horizontal"},{label:(0,ne.__)("Vertical","instant-images"),value:"vertical"}],ue=[{label:(0,ne.__)("Photo","instant-images"),value:"photo"},{label:(0,ne.__)("Illustration","instant-images"),value:"illustration"},{label:(0,ne.__)("Vector","instant-images"),value:"vector"}],fe=[{label:(0,ne.__)("Black & White","instant-images"),value:"black_and_white"},{label:(0,ne.__)("Black","instant-images"),value:"black"},{label:(0,ne.__)("White","instant-images"),value:"white"},{label:(0,ne.__)("Yellow","instant-images"),value:"yellow"},{label:(0,ne.__)("Green","instant-images"),value:"green"},{label:(0,ne.__)("Orange","instant-images"),value:"orange"},{label:(0,ne.__)("Red","instant-images"),value:"red"},{label:(0,ne.__)("Purple","instant-images"),value:"purple"},{label:(0,ne.__)("Magenta","instant-images"),value:"magenta"},{label:(0,ne.__)("Teal","instant-images"),value:"teal"},{label:(0,ne.__)("Blue","instant-images"),value:"blue"}],he=[{label:(0,ne.__)("Landscape","instant-images"),value:"landscape"},{label:(0,ne.__)("Portrait","instant-images"),value:"portrait"},{label:(0,ne.__)("Square","instant-images"),value:"squarish"}];function de(t){return function(t){if(Array.isArray(t))return pe(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return pe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pe(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1&&parseInt(n)<2&&alert(instant_img_localize.api_ratelimit_msg)}}function Te(t){return t.charAt(0).toUpperCase()+t.slice(1)}var Ie="";function De(t){var e=t.currentTarget,n=e.getBoundingClientRect(),r=Math.round(n.left),i=Math.round(n.top),o=e.closest("#photo-listing").querySelector("#tooltip");o.classList.remove("over"),e.classList.contains("tooltip--above")?o.classList.add("above"):o.classList.remove("above"),Ie=setInterval((function(){clearInterval(Ie),o.innerHTML=e.dataset.title,r=r-o.offsetWidth+e.offsetWidth+5,o.style.left="".concat(r,"px"),o.style.top="".concat(i,"px"),setTimeout((function(){o.classList.add("over")}),25)}),750)}function Me(t){clearInterval(Ie),t.currentTarget.closest("#photo-listing").querySelector("#tooltip").classList.remove("over")}function Fe(t){t&&window&&window.open(t,"_blank")}function He(){var t=instant_img_localize;switch(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200){case 400:case 401:return t.api_invalid_msg;case 403:return t.api_invalid_403_msg;case 404:return t.api_invalid_404_msg;case 429:return t.api_ratelimit_msg;case 500:case 503:return t.api_invalid_500_msg;case 501:return t.api_invalid_501_msg}}function We(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=instant_img_localize,r=He(e);switch(e){case 400:case 401:case 500:case 429:console.warn("[".concat(n.instant_images," - ").concat(e," Error] ").concat(Te(t),": ").concat(r))}}function Ue(t){return t&&t[ee.defaults.arr_key]||[]}function qe(t){return void 0===t.total||null===t.total?0:t.total}function Ve(t){if(!t||ee.testmode)return!1;var e=sessionStorage.getItem(Pe(t));if(!e)return!1;var n=JSON.parse(e),r=n.expires,i=void 0===r?0:r,o=n.error;if(void 0!==o&&o)return!1;var a=Date.now()>i;return a&&Ye(t),!(!n||a)&&n}function Ge(t,e){if(!t||!e||null!=e&&e.error)return!1;e.expires=Date.now()+36e5,sessionStorage.setItem(Pe(t),JSON.stringify(e))}function Ye(t){if(!t)return!1;sessionStorage.removeItem(Pe(t))}function Je(t){return Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Je(t)}function Ke(){Ke=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new x(i||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==e&&n.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function i(r,o,a,s){var c=u(t[r],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==Je(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function E(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=u(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Xe(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function $e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,_x,o,a=[],_n=!0,s=!1;try{if(_x=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;_n=!1}else for(;!(_n=(r=_x.call(n)).done)&&(a.push(r.value),a.length!==e);_n=!0);}catch(t){s=!0,i=t}finally{try{if(!_n&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ze(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ze(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=1?null:React.createElement("div",{className:"instant-images-no-results"},React.createElement("div",null,React.createElement("h3",null,instant_img_localize.no_results," "),React.createElement("p",null,instant_img_localize.no_results_desc," ")))}var ln=ee.providers;function un(t){var e=t.switchProvider,n=Qt().provider;return React.createElement(r.Fragment,null,!(null==ln||!ln.length)&&React.createElement("nav",{className:"provider-nav"},ln.map((function(t,r){return React.createElement("div",{key:"provider-".concat(r)},React.createElement("button",{onClick:function(){return e(t.toLowerCase())},className:n===t.toLowerCase()?"provider-nav--btn active":"provider-nav--btn"},te(t),React.createElement("span",null,t),ee[t.toLowerCase()].new&&React.createElement("span",{className:"provider-nav--new"},instant_img_localize.new)))}))))}function fn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=200&&e.status<400&&JSON.parse(e.response).success||o(!1)},e.onerror=function(t){console.warn(t),o(!1)}}),[]),React.createElement(r.Fragment,null,i?null:React.createElement("div",{className:"error-messaging"},React.createElement("strong",null,instant_img_localize.error_restapi),instant_img_localize.error_restapi_desc))}const dn=window.wp.blocks,pn=window.wp.data;function mn(t,e){var n=t.id,r=void 0===n?null:n,i=t.url,o=void 0===i?null:i,a=t.caption,s=void 0===a?"":a,c=t.alt,l=void 0===c?"":c;if(o&&r){var u=(0,dn.createBlock)("core/image",{id:r,url:o,caption:s,alt:l});e?(0,pn.dispatch)("core/block-editor").replaceBlock(e,u):(0,pn.dispatch)("core/block-editor").insertBlocks(u)}}function vn(t){return vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vn(t)}function gn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yn(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&React.createElement("img",{className:"user-wrap--photo",src:L,alt:""}),A)),React.createElement("div",{className:"photo-options"},f&&!$?React.createElement(r.Fragment,null,React.createElement("button",{type:"button",className:"set-featured fade","data-title":instant_img_localize.set_as_featured,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)},onClick:function(t){return function(t){Me(t),tt.current&&(rt=!0,tt.current.click())}(t)}},React.createElement("i",{className:"fa fa-picture-o","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.set_as_featured)),React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)},onClick:function(t){return ot(t)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post))):null,!!s&&React.createElement("button",{type:"button",className:"insert fade","data-title":instant_img_localize.insert_into_post,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)},onClick:function(t){return ot(t)}},React.createElement("i",{className:"fa fa-plus","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.insert_into_post)),$?React.createElement("button",{onClick:function(){$&&(window.location=$)},className:"edit-photo-admin fade","data-title":instant_img_localize.edit_upload,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)}},React.createElement("i",{className:"fa fa-pencil","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_upload)):React.createElement("button",{onClick:function(t){return function(t){t.preventDefault(),Me(t);var e=document.querySelectorAll(".edit-screen.editing");e&&e.forEach((function(t){t.classList.remove("editing")})),et.current.classList.add("editing"),setTimeout((function(){et.current.focus({preventScroll:!0})}),150)}(t)},className:"edit-photo fade","data-title":instant_img_localize.edit_details,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)}},React.createElement("i",{className:"fa fa-cog","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},instant_img_localize.edit_details)))),React.createElement("div",{className:"photo-meta"},E?React.createElement("span",{className:"likes tooltip--above","data-title":E+" "+N,onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)}},React.createElement("i",{className:"fa fa-heart heart-like","aria-hidden":"true"})," ",E):null,React.createElement("a",{className:"tooltip--above",href:m,"data-title":"".concat(instant_img_localize.open_external," ").concat(Te(o)),onMouseEnter:function(t){return De(t)},onMouseLeave:function(t){return Me(t)},rel:"noopener noreferrer",target:"_blank"},React.createElement("i",{className:"fa fa-external-link","aria-hidden":"true"}),React.createElement("span",{className:"offscreen"},"".concat(instant_img_localize.open_external," ").concat(Te(o)))))),React.createElement("div",{className:"edit-screen",tabIndex:"0",ref:et},React.createElement("div",{className:"edit-screen--title"},React.createElement("div",null,React.createElement("p",{className:"heading"},instant_img_localize.edit_details),S&&S.length>0&&React.createElement("p",{className:"dimensions"},S)),React.createElement("div",{className:"preview",style:{backgroundImage:"url(".concat(k,")")}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_filename,":"),React.createElement("input",{type:"text",name:"filename","data-original":p,placeholder:W.filename,value:W.filename,onChange:function(t){return ct(t)}}),React.createElement("em",null,".",w)),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_title,":"),React.createElement("input",{type:"text",name:"title","data-original":v,placeholder:v,value:W.title||"",onChange:function(t){return ct(t)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_alt,":"),React.createElement("input",{type:"text",name:"alt","data-original":g,value:W.alt||"",onChange:function(t){return ct(t)}})),React.createElement("label",null,React.createElement("span",null,instant_img_localize.edit_caption,":"),React.createElement("textarea",{rows:"4",name:"caption","data-original":F,onChange:function(t){return ct(t)},value:W.caption||"",ref:nt})),M?React.createElement("div",{className:"add-attribution-row"},React.createElement("button",{onClick:function(t){return function(t){t.preventDefault(),nt.current.value=M,U(yn(yn({},W),{},{caption:M}))}(t)},type:"button"},instant_img_localize.attribution)):null,React.createElement("div",{className:"edit-screen--controls"},React.createElement("button",{type:"button",className:"button button-secondary",onClick:function(t){return U({filename:p,title:v,alt:g,caption:F}),et.current.classList.remove("editing"),void tt.current.focus({preventScrol:!0})}},instant_img_localize.cancel)," "," ",React.createElement("button",{type:"button",className:"button button-primary",onClick:function(){return et.current.classList.remove("editing"),void tt.current.click()}},s?instant_img_localize.insert_into_post:instant_img_localize.upload_now))),React.createElement("div",{className:"photo-status"})))}function Rn(t){var e=t.result.data,n=void 0===e?null:e,i=(null==n?void 0:n.url)||"",o=(null==n?void 0:n.title)||"",a=(null==n?void 0:n.description)||"",s=(null==n?void 0:n.avatar)||"",c=n.image,l=void 0===c?null:c,u=l.src,f=void 0===u?null:u,h=l.alt,d=void 0===h?null:h,p=(0,r.useRef)(),m=(0,r.useRef)();return React.createElement(r.Fragment,null,l&&i?React.createElement("article",{className:"photo feature",title:a,ref:p,onClick:function(){return m.current.click()}},React.createElement("div",{className:"photo--wrap"},React.createElement("span",{className:"flag",title:instant_img_localize.advertisement},instant_img_localize.ad),React.createElement("div",{className:"img-wrap"},React.createElement("a",{className:"loaded",href:i,target:"_blank",ref:m,rel:"noreferrer"},React.createElement("img",{src:f,alt:d}))),React.createElement("div",{className:"feature-title"},s&&React.createElement("img",{src:s,alt:o}),React.createElement("span",null,o)))):null)}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1&&e.splice(n,1),e.length>=10&&(e.length=10),e.unshift(t),localStorage.setItem(Pn,JSON.stringify(e))}else localStorage.setItem(Pn,JSON.stringify([t]))}(r),g(Tn())))}(t)},autoComplete:"off"},React.createElement("label",{htmlFor:"search-input",className:"offscreen"},instant_img_localize.search_label),React.createElement("div",{ref:w},React.createElement("input",{ref:e,type:"text",id:"search-input",placeholder:instant_img_localize.search,disabled:h,onChange:function(t){return l&&p(t.target.value)},onFocus:function(){return b(!0)}}),l&&((null==v?void 0:v.length)||(null==d?void 0:d.length))?React.createElement(Un,{show:_,history:v,setHistory:g,setSearchValue:function(t){var n=null==e?void 0:e.current;n.value=t,null==E||E.current.click(),n.focus()},container:w}):null,!s&&React.createElement(Wn,{show:_})),React.createElement("button",{type:"submit",disabled:h,ref:E},React.createElement("i",{className:"fa fa-search"}),React.createElement("span",{className:"offscreen"},instant_img_localize.search)),React.createElement(qn,{show:_})))}));function Jn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function Zn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Qn(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==h[0]&&h[0],!D){t.next=3;break}return t.abrupt("return",!1);case 3:if(n||""===(null==pt||null===(e=pt.current)||void 0===e?void 0:e.value)){t.next=7;break}if(!v||!y){t.next=7;break}return Ot(pt.current.value),t.abrupt("return");case 7:if(T(!0),d=void 0,(null==pt||null===(d=pt.current)||void 0===d?void 0:d.value)&&(pt.current.value=""),$(w),tt([]),Pt(),cr=1,r=Re(k,ot),i=Le("photos",r),!(o=Ve(i))){t.next=18;break}At(Ue(o),!1,null),t.next=37;break;case 18:return t.next=20,fetch(i);case 20:return a=t.sent,c=a.status,ze(a.headers),t.prev=23,t.next=26,a.json();case 26:l=t.sent,u=l.error,f=void 0===u?null:u,At(Ue(l),!1,f),Ge(i,l),t.next=37;break;case 32:t.prev=32,t.t0=t.catch(23),We(s,c),T(!1),Ye(i);case 37:setTimeout((function(){T(!1)}),_);case 38:case"end":return t.stop()}var d}),t,null,[[23,32]])}))),Rt.apply(this,arguments)}function xt(){return kt.apply(this,arguments)}function kt(){return(kt=rr($n().mark((function t(){var e,n,r,i,o,a,c,l,u,f,h,d;return $n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(j&&!z&&!D&&!H){t.next=2;break}return t.abrupt("return");case 2:if(M(!0),cr=parseInt(cr)+1,e=null!=X&&X.active&&null!=X&&X.term?{term:X.term}:{},n=null!=X&&X.active?"search":"photos",r=null!=X&&X.active?ct:ot,i=Qn(Qn(Qn({},{page:cr}),e),r),o=Re(k,i),a=Le(n,o),!(c=Ve(a))){t.next=15;break}At(Ue(c),!0,null),t.next=34;break;case 15:return t.next=17,fetch(a);case 17:return l=t.sent,u=l.status,ze(l.headers),t.prev=20,t.next=23,l.json();case 23:f=t.sent,h=f.error,d=void 0===h?null:h,At(Ue(f),!0,d),Ge(a,f),t.next=34;break;case 29:t.prev=29,t.t0=t.catch(20),We(s,u),M(!1),Ye(a);case 34:case"end":return t.stop()}}),t,null,[[20,29]])})))).apply(this,arguments)}function Ot(t){return Ct.apply(this,arguments)}function Ct(){return(Ct=rr($n().mark((function t(e){var n,r,i,o,a,c,l,u,f,h,d;return $n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(T(!0),Pt(),cr=1,n="id:"===e.substring(0,3)?"id":"term",r="id"===n?{id:e.replace("id:","").replace(/\s+/,"")}:{term:e},i=Qn(Qn(Qn({},{page:cr}),r),ct),o=Re(k,i),a=Le("search",o),!(c=Ve(a))){t.next=14;break}At(Ue(c),!1,null),$({active:!0,term:e,type:n,results:qe(c)}),t.next=35;break;case 14:return t.next=16,fetch(a);case 16:return l=t.sent,u=l.status,ze(l.headers),t.prev=19,t.next=22,l.json();case 22:f=t.sent,h=f.error,d=void 0===h?null:h,At(Ue(f),!1,d),$({active:!0,term:e,type:n,results:qe(f)}),Ge(a,f),t.next=35;break;case 29:t.prev=29,t.t0=t.catch(19),W(!0),T(!1),We(s,u),Ye(a);case 35:pt.current.classList.remove(b);case 36:case"end":return t.stop()}}),t,null,[[19,29]])})))).apply(this,arguments)}function At(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;t=null==e?void 0:e.length,W(0===parseInt(t)||void 0===t),R(n?function(t){return[].concat(er(t),er(e))}:e),V(r)}function Lt(t,e){var n=Qn({},ot);n[t]&&"#"===e||""===e||"all"===e?delete n[t]:n[t]=e,at(Qn({},n))}function Bt(t){return jt.apply(this,arguments)}function jt(){return(jt=rr($n().mark((function t(e){var n,r;return $n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(k!==e){t.next=2;break}return t.abrupt("return");case 2:if(T(!0),V(!1),J(!1),bt.classList.remove("overflow-hidden"),!ee[e].requires_key||A.includes(e)){t.next=27;break}return t.prev=7,t.next=10,fetch(Be(e));case 10:if(n=t.sent,r=n.status,ze(n.headers),200===r){t.next=18;break}return J(e),V(!0),bt.classList.add("overflow-hidden"),t.abrupt("return");case 18:200===r&&L((function(t){return[].concat(er(t),[e])})),t.next=27;break;case 21:return t.prev=21,t.t0=t.catch(7),J(e),bt.classList.add("overflow-hidden"),V(!0),t.abrupt("return");case 27:setTimeout((function(){rt(ve[e].filters),O(e)}),_);case 28:case"end":return t.stop()}}),t,null,[[7,21]])})))).apply(this,arguments)}function Nt(){return(Nt=rr($n().mark((function t(e){var n;return $n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&!((null==e?void 0:e.length)<3)){t.next=2;break}return t.abrupt("return");case 2:return n=instant_img_localize.root+"instant-images-extended/suggestions/?term=".concat(e),t.next=5,Mt.get(n).then((function(t){tt(t.data)})).catch((function(t){console.warn(t)}));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Pt(){vt&&null!=dt&&dt.current&&(null==dt||dt.current.scroll({top:0,left:0,behavior:"smooth"}))}function zt(t){if("Escape"===t.key){var e=dt.current.querySelectorAll(".edit-screen.editing");e&&er(e).forEach((function(t){null==t||t.classList.remove("editing")}))}}return(0,r.useEffect)((function(){null!=X&&X.active||lt({})}),[X]),(0,r.useEffect)((function(){j&&null!=X&&X.active&&Ot(null==X?void 0:X.term)}),[ct]),(0,r.useEffect)((function(){j&&St()}),[ot]),(0,r.useEffect)((function(){rt(ve[k].filters),at({})}),[k]),(0,r.useEffect)((function(){xt()}),[ht]),(0,r.useEffect)((function(){sr(dt.current,(function(){yt||(mt.current=new(Ut())(dt.current,{itemSelector:".photo"}),dt.current.querySelectorAll(".photo").forEach((function(t){t.classList.add("in-view")}))),setTimeout((function(){T(!1),M(!1),j||N(!0)}),_)}))}),[S]),(0,r.useEffect)((function(){return T(!1),Et.classList.add("loaded"),yt&&St(),document.addEventListener("keydown",zt,!1),function(){document.removeEventListener("keydown",zt,!1)}}),[]),React.createElement(r.Fragment,null,React.createElement(Zt,{value:{provider:k,wpBlock:vt,mediaModal:_t,blockSidebar:gt,clientId:d,search:X,apiError:q,getPhotos:St,searchHandler:function(t){t.preventDefault();var e=pt.current.value;e.length>2?(pt.current.classList.add(b),Ot(e)):pt.current.focus()},filterSearch:function(t,e){var n=Qn({},ct);n[t]&&"#"===e||""===e||"all"===e?delete n[t]:n[t]=e,lt(Qn({},n))},suggestions:Q,getSuggestions:function(t){return Nt.apply(this,arguments)}}},vt?React.createElement(_e,{switchProvider:Bt}):React.createElement(React.Fragment,null,React.createElement(un,{switchProvider:Bt}),React.createElement(Hn,null)),React.createElement(hn,null),React.createElement("div",{className:"control-nav"},React.createElement("div",{className:Ht()("control-nav--filters-wrap",q||null!=X&&X.active?"inactive":null)},nt&&null!==(i=Object.entries(nt))&&void 0!==i&&i.length?React.createElement("div",{className:"control-nav--filters"},Object.entries(nt).map((function(t,e){var n=ir(t,2),r=n[0],i=n[1];return React.createElement(an,{key:"".concat(k,"-").concat(e,"-").concat(r),data:i,filterKey:r,handler:Lt})}))):null),React.createElement(Yn,{ref:pt})),React.createElement("div",{id:"photo-listing",className:z?"loading":null},React.createElement(Kn,null),vt?React.createElement(Bn,{ref:dt,data:S,done:H,loadMorePhotos:xt}):React.createElement(kn,{ref:dt,data:S}),React.createElement(cn,{total:null==X?void 0:X.results,is_search:null==X?void 0:X.active}),React.createElement(sn,{ref:ft,loadMorePhotos:xt,loading:D,done:H}),React.createElement(Qe,{provider:Y,callback:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t&&O(t),J(!1),T(!1),V(!1),bt.classList.remove("overflow-hidden")}}),React.createElement(tn,null),React.createElement(jn,null))))}function ur(t){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ur(t)}function fr(){fr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var o=e&&e.prototype instanceof h?e:h,a=Object.create(o.prototype),s=new x(i||[]);return r(a,"_invoke",{value:w(t,n,s)}),a}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function h(){}function d(){}function p(){}var m={};c(m,o,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==e&&n.call(g,o)&&(m=g);var y=p.prototype=h.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function i(r,o,a,s){var c=u(t[r],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==ur(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(c.arg)}var o;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return o=o?o.then(r,r):r()}})}function w(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=u(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}function E(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=u(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function hr(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function dr(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){hr(o,r,i,a,s,"next",t)}function s(t){hr(o,r,i,a,s,"throw",t)}a(void 0)}))}}var pr=instant_img_localize&&instant_img_localize.default_provider?instant_img_localize.default_provider:ee.defaults.provider;function mr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ee.defaults.provider,e=Le("photos",Re(t));function n(){return(n=dr(fr().mark((function n(){var i,o,a,s,c,l,u;return fr().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(i=document.getElementById("app"))){n.next=25;break}if(!(o=Ve(e))){n.next=7;break}r.createRoot?(0,r.createRoot)(i).render(React.createElement(lr,{editor:"classic",data:o,container:i,provider:t,api_error:null})):(0,r.render)(React.createElement(lr,{editor:"classic",data:o,container:i,provider:t,api_error:null}),i),n.next=25;break;case 7:return n.next=9,fetch(e);case 9:return a=n.sent,s=a.status,ze(a.headers),n.prev=12,n.next=15,a.json();case 15:c=n.sent,l=c.error,u=void 0===l?null:l,r.createRoot?(0,r.createRoot)(i).render(React.createElement(lr,{editor:"classic",data:c,container:i,provider:t,api_error:u})):(0,r.render)(React.createElement(lr,{editor:"classic",data:c,container:i,provider:t,api_error:u}),i),Ge(e,c),n.next=25;break;case 21:n.prev=21,n.t0=n.catch(12),We(t,s),Ye(e);case 25:case"end":return n.stop()}}),n,null,[[12,21]])})))).apply(this,arguments)}!function(){n.apply(this,arguments)}()}dr(fr().mark((function t(){return fr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:mr(pr);case 1:case"end":return t.stop()}}),t)})))()},4184:(t,e)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var t=[],e=0;e>>8^255&p^99,i[n]=p,o[p]=n;var m=t[n],v=t[m],g=t[v],y=257*t[p]^16843008*p;a[n]=y<<24|y>>>8,s[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,l[n]=y,y=16843009*g^65537*v^257*m^16843008*n,u[p]=y<<24|y>>>8,f[p]=y<<16|y>>>16,h[p]=y<<8|y>>>24,d[p]=y,n?(n=m^t[t[t[g^m]]],r^=t[t[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,n=t.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a6&&a%n==4&&(l=i[l>>>24]<<24|i[l>>>16&255]<<16|i[l>>>8&255]<<8|i[255&l]):(l=i[(l=l<<8|l>>>24)>>>24]<<24|i[l>>>16&255]<<16|i[l>>>8&255]<<8|i[255&l],l^=p[a/n|0]<<24),o[a]=o[a-n]^l);for(var s=this._invKeySchedule=[],c=0;c>>24]]^f[i[l>>>16&255]]^h[i[l>>>8&255]]^d[i[255&l]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,c,l,i)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,u,f,h,d,o),n=t[e+1],t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,r,i,o,a,s){for(var c=this._nRounds,l=t[e]^n[0],u=t[e+1]^n[1],f=t[e+2]^n[2],h=t[e+3]^n[3],d=4,p=1;p>>24]^i[u>>>16&255]^o[f>>>8&255]^a[255&h]^n[d++],v=r[u>>>24]^i[f>>>16&255]^o[h>>>8&255]^a[255&l]^n[d++],g=r[f>>>24]^i[h>>>16&255]^o[l>>>8&255]^a[255&u]^n[d++],y=r[h>>>24]^i[l>>>16&255]^o[u>>>8&255]^a[255&f]^n[d++];l=m,u=v,f=g,h=y}m=(s[l>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&h])^n[d++],v=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[h>>>8&255]<<8|s[255&l])^n[d++],g=(s[f>>>24]<<24|s[h>>>16&255]<<16|s[l>>>8&255]<<8|s[255&u])^n[d++],y=(s[h>>>24]<<24|s[l>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^n[d++],t[e]=m,t[e+1]=v,t[e+2]=g,t[e+3]=y},keySize:8});t.AES=e._createHelper(m)}(),r.AES)},5109:function(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,m,v,g,y,_,b,w;t.exports=(r=n(8249),n(888),void(r.lib.Cipher||(i=r,o=i.lib,a=o.Base,s=o.WordArray,c=o.BufferedBlockAlgorithm,l=i.enc,l.Utf8,u=l.Base64,f=i.algo.EvpKDF,h=o.Cipher=c.extend({cfg:a.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?w:_}return function(e){return{encrypt:function(n,r,i){return t(r).encrypt(e,n,r,i)},decrypt:function(n,r,i){return t(r).decrypt(e,n,r,i)}}}}()}),o.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),d=i.mode={},p=o.BlockCipherMode=a.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),m=d.CBC=function(){var t=p.extend();function e(t,e,n){var r,i=this._iv;i?(r=i,this._iv=void 0):r=this._prevBlock;for(var o=0;o>>2];t.sigBytes-=e}},o.BlockCipher=h.extend({cfg:h.cfg.extend({mode:m,padding:v}),reset:function(){var t;h.reset.call(this);var e=this.cfg,n=e.iv,r=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=r.createEncryptor:(t=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,n&&n.words):(this._mode=t.call(r,this,n&&n.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),g=o.CipherParams=a.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),y=(i.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;return(n?s.create([1398893684,1701076831]).concat(n).concat(e):e).toString(u)},parse:function(t){var e,n=u.parse(t),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(e=s.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:e})}},_=o.SerializableCipher=a.extend({cfg:a.extend({format:y}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var i=t.createEncryptor(n,r),o=i.finalize(e),a=i.cfg;return g.create({ciphertext:o,key:n,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(n,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),b=(i.kdf={}).OpenSSL={execute:function(t,e,n,r){r||(r=s.random(8));var i=f.create({keySize:e+n}).compute(t,r),o=s.create(i.words.slice(e),4*n);return i.sigBytes=4*e,g.create({key:i,iv:o,salt:r})}},w=o.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:b}),encrypt:function(t,e,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,t.keySize,t.ivSize);r.iv=i.iv;var o=_.encrypt.call(this,t,e,i.key,r);return o.mixIn(i),o},decrypt:function(t,e,n,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var i=r.kdf.execute(n,t.keySize,t.ivSize,e.salt);return r.iv=i.iv,_.decrypt.call(this,t,e,i.key,r)}}))))},8249:function(t,e,n){var r;t.exports=(r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(2480)}catch(t){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),a={},s=a.lib={},c=s.Base={extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},l=s.WordArray=c.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var s=0;s>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=c.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],n=0;n>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new l.init(n,e/2)}},h=u.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new l.init(n,e)}},d=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(h.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return h.parse(unescape(encodeURIComponent(t)))}},p=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),c=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*a,u=t.min(4*c,o);if(c){for(var f=0;f>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(t){var e=t.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i>>6-a%4*2;r[i>>>2]|=s<<24-i%4*8,i++}return o.create(r,i)}(t,e,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)},3786:function(t,e,n){var r,i,o;t.exports=(r=n(8249),o=(i=r).lib.WordArray,i.enc.Base64url={stringify:function(t,e=!0){var n=t.words,r=t.sigBytes,i=e?this._safe_map:this._map;t.clamp();for(var o=[],a=0;a>>2]>>>24-a%4*8&255)<<16|(n[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|n[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c>>6*(3-c)&63));var l=i.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(t,e=!0){var n=t.length,r=e?this._safe_map:this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a>>6-a%4*2;r[i>>>2]|=s<<24-i%4*8,i++}return o.create(r,i)}(t,n,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},r.enc.Base64url)},298:function(t,e,n){var r;t.exports=(r=n(8249),function(){var t=r,e=t.lib.WordArray,n=t.enc;function i(t){return t<<8&4278255360|t>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var n=t.length,r=[],i=0;i>>1]|=t.charCodeAt(i)<<16-i%2*16;return e.create(r,2*n)}},n.Utf16LE={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(t){for(var n=t.length,r=[],o=0;o>>1]|=i(t.charCodeAt(o)<<16-o%2*16);return e.create(r,2*n)}}}(),r.enc.Utf16)},888:function(t,e,n){var r,i,o,a,s,c,l,u;t.exports=(u=n(8249),n(2783),n(9824),o=(i=(r=u).lib).Base,a=i.WordArray,c=(s=r.algo).MD5,l=s.EvpKDF=o.extend({cfg:o.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n,r=this.cfg,i=r.hasher.create(),o=a.create(),s=o.words,c=r.keySize,l=r.iterations;s.lengthr&&(e=t.finalize(e)),e.clamp();for(var i=this._oKey=e.clone(),a=this._iKey=e.clone(),s=i.words,c=a.words,l=0;l>>2]|=t[i]<<24-i%4*8;e.call(this,r,n)}else e.apply(this,arguments)};n.prototype=t}}(),r.lib.WordArray)},8214:function(t,e,n){var r;t.exports=(r=n(8249),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var r=e+n,i=t[r];t[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=t[e+0],c=t[e+1],d=t[e+2],p=t[e+3],m=t[e+4],v=t[e+5],g=t[e+6],y=t[e+7],_=t[e+8],b=t[e+9],w=t[e+10],E=t[e+11],S=t[e+12],R=t[e+13],x=t[e+14],k=t[e+15],O=o[0],C=o[1],A=o[2],L=o[3];O=l(O,C,A,L,a,7,s[0]),L=l(L,O,C,A,c,12,s[1]),A=l(A,L,O,C,d,17,s[2]),C=l(C,A,L,O,p,22,s[3]),O=l(O,C,A,L,m,7,s[4]),L=l(L,O,C,A,v,12,s[5]),A=l(A,L,O,C,g,17,s[6]),C=l(C,A,L,O,y,22,s[7]),O=l(O,C,A,L,_,7,s[8]),L=l(L,O,C,A,b,12,s[9]),A=l(A,L,O,C,w,17,s[10]),C=l(C,A,L,O,E,22,s[11]),O=l(O,C,A,L,S,7,s[12]),L=l(L,O,C,A,R,12,s[13]),A=l(A,L,O,C,x,17,s[14]),O=u(O,C=l(C,A,L,O,k,22,s[15]),A,L,c,5,s[16]),L=u(L,O,C,A,g,9,s[17]),A=u(A,L,O,C,E,14,s[18]),C=u(C,A,L,O,a,20,s[19]),O=u(O,C,A,L,v,5,s[20]),L=u(L,O,C,A,w,9,s[21]),A=u(A,L,O,C,k,14,s[22]),C=u(C,A,L,O,m,20,s[23]),O=u(O,C,A,L,b,5,s[24]),L=u(L,O,C,A,x,9,s[25]),A=u(A,L,O,C,p,14,s[26]),C=u(C,A,L,O,_,20,s[27]),O=u(O,C,A,L,R,5,s[28]),L=u(L,O,C,A,d,9,s[29]),A=u(A,L,O,C,y,14,s[30]),O=f(O,C=u(C,A,L,O,S,20,s[31]),A,L,v,4,s[32]),L=f(L,O,C,A,_,11,s[33]),A=f(A,L,O,C,E,16,s[34]),C=f(C,A,L,O,x,23,s[35]),O=f(O,C,A,L,c,4,s[36]),L=f(L,O,C,A,m,11,s[37]),A=f(A,L,O,C,y,16,s[38]),C=f(C,A,L,O,w,23,s[39]),O=f(O,C,A,L,R,4,s[40]),L=f(L,O,C,A,a,11,s[41]),A=f(A,L,O,C,p,16,s[42]),C=f(C,A,L,O,g,23,s[43]),O=f(O,C,A,L,b,4,s[44]),L=f(L,O,C,A,S,11,s[45]),A=f(A,L,O,C,k,16,s[46]),O=h(O,C=f(C,A,L,O,d,23,s[47]),A,L,a,6,s[48]),L=h(L,O,C,A,y,10,s[49]),A=h(A,L,O,C,x,15,s[50]),C=h(C,A,L,O,v,21,s[51]),O=h(O,C,A,L,S,6,s[52]),L=h(L,O,C,A,p,10,s[53]),A=h(A,L,O,C,w,15,s[54]),C=h(C,A,L,O,c,21,s[55]),O=h(O,C,A,L,_,6,s[56]),L=h(L,O,C,A,k,10,s[57]),A=h(A,L,O,C,g,15,s[58]),C=h(C,A,L,O,R,21,s[59]),O=h(O,C,A,L,m,6,s[60]),L=h(L,O,C,A,E,10,s[61]),A=h(A,L,O,C,d,15,s[62]),C=h(C,A,L,O,b,21,s[63]),o[0]=o[0]+O|0,o[1]=o[1]+C|0,o[2]=o[2]+A|0,o[3]=o[3]+L|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/4294967296),a=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function l(t,e,n,r,i,o,a){var s=t+(e&n|~e&r)+i+a;return(s<>>32-o)+e}function u(t,e,n,r,i,o,a){var s=t+(e&r|n&~r)+i+a;return(s<>>32-o)+e}function f(t,e,n,r,i,o,a){var s=t+(e^n^r)+i+a;return(s<>>32-o)+e}function h(t,e,n,r,i,o,a){var s=t+(n^(e|~r))+i+a;return(s<>>32-o)+e}e.MD5=o._createHelper(c),e.HmacMD5=o._createHmacHelper(c)}(Math),r.MD5)},8568:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.mode.CFB=function(){var t=r.lib.BlockCipherMode.extend();function e(t,e,n,r){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var a=0;a>24&255)){var e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}else t+=1<<24;return t}var n=t.Encryptor=t.extend({processBlock:function(t,n){var r=this._cipher,i=r.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=e(t[0]))&&(t[1]=e(t[1]))}(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c>>2]|=i<<24-o%4*8,t.sigBytes+=i},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},r.pad.Ansix923)},2807:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.Iso10126={pad:function(t,e){var n=4*e,i=n-t.sigBytes%n;t.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},r.pad.Iso10126)},1077:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.Iso97971={pad:function(t,e){t.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(t,e)},unpad:function(t){r.pad.ZeroPadding.unpad(t),t.sigBytes--}},r.pad.Iso97971)},6991:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)},6475:function(t,e,n){var r;t.exports=(r=n(8249),n(5109),r.pad.ZeroPadding={pad:function(t,e){var n=4*e;t.clamp(),t.sigBytes+=n-(t.sigBytes%n||n)},unpad:function(t){var e=t.words,n=t.sigBytes-1;for(n=t.sigBytes-1;n>=0;n--)if(e[n>>>2]>>>24-n%4*8&255){t.sigBytes=n+1;break}}},r.pad.ZeroPadding)},2112:function(t,e,n){var r,i,o,a,s,c,l,u,f;t.exports=(f=n(8249),n(2783),n(9824),o=(i=(r=f).lib).Base,a=i.WordArray,c=(s=r.algo).SHA1,l=s.HMAC,u=s.PBKDF2=o.extend({cfg:o.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=this.cfg,r=l.create(n.hasher,t),i=a.create(),o=a.create([1]),s=i.words,c=o.words,u=n.keySize,f=n.iterations;s.length>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],r=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(e){var o=e.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=l>>>16|4294901760&u,h=u<<16|65535&l;for(r[0]^=l,r[1]^=f,r[2]^=u,r[3]^=h,r[4]^=l,r[5]^=f,r[6]^=u,r[7]^=h,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(t,e){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),t[e+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,n=0;n<8;n++)o[n]=e[n];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,n=0;n<8;n++){var r=t[n]+e[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^l}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.RabbitLegacy=e._createHelper(s)}(),r.RabbitLegacy)},4454:function(t,e,n){var r;t.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var t=r,e=t.lib.StreamCipher,n=t.algo,i=[],o=[],a=[],s=n.Rabbit=e.extend({_doReset:function(){for(var t=this._key.words,e=this.cfg.iv,n=0;n<4;n++)t[n]=16711935&(t[n]<<8|t[n]>>>24)|4278255360&(t[n]<<24|t[n]>>>8);var r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var o=e.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=l>>>16|4294901760&u,h=u<<16|65535&l;for(i[0]^=l,i[1]^=f,i[2]^=u,i[3]^=h,i[4]^=l,i[5]^=f,i[6]^=u,i[7]^=h,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(t,e){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),t[e+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,n=0;n<8;n++)o[n]=e[n];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,n=0;n<8;n++){var r=t[n]+e[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^l}t[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,t[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,t[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,t[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,t[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,t[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,t[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,t[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.Rabbit=e._createHelper(s)}(),r.Rabbit)},1857:function(t,e,n){var r;t.exports=(r=n(8249),n(8269),n(8214),n(888),n(5109),function(){var t=r,e=t.lib.StreamCipher,n=t.algo,i=n.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,n=t.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;i=0;for(var o=0;i<256;i++){var a=i%n,s=e[a>>>2]>>>24-a%4*8&255;o=(o+r[i]+s)%256;var c=r[i];r[i]=r[o],r[o]=c}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var t=this._S,e=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[n],t[n]=o,r|=t[(t[e]+t[n])%256]<<24-8*i}return this._i=e,this._j=n,r}t.RC4=e._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)o.call(this)}});t.RC4Drop=e._createHelper(a)}(),r.RC4)},706:function(t,e,n){var r;t.exports=(r=n(8249),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=0;n<16;n++){var r=e+n,i=t[r];t[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,b,w,E,S,R,x,k,O,C=this._hash.words,A=f.words,L=h.words,B=s.words,j=c.words,N=l.words,P=u.words;for(E=o=C[0],S=a=C[1],R=d=C[2],x=b=C[3],k=w=C[4],n=0;n<80;n+=1)O=o+t[e+B[n]]|0,O+=n<16?p(a,d,b)+A[0]:n<32?m(a,d,b)+A[1]:n<48?v(a,d,b)+A[2]:n<64?g(a,d,b)+A[3]:y(a,d,b)+A[4],O=(O=_(O|=0,N[n]))+w|0,o=w,w=b,b=_(d,10),d=a,a=O,O=E+t[e+j[n]]|0,O+=n<16?y(S,R,x)+L[0]:n<32?g(S,R,x)+L[1]:n<48?v(S,R,x)+L[2]:n<64?m(S,R,x)+L[3]:p(S,R,x)+L[4],O=(O=_(O|=0,P[n]))+k|0,E=k,k=x,x=_(R,10),R=S,S=O;O=C[1]+d+x|0,C[1]=C[2]+b+k|0,C[2]=C[3]+w+E|0,C[3]=C[4]+o+S|0,C[4]=C[0]+a+R|0,C[0]=O},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,n){return t^e^n}function m(t,e,n){return t&e|~t&n}function v(t,e,n){return(t|~e)^n}function g(t,e,n){return t&n|e&~n}function y(t,e,n){return t^(e|~n)}function _(t,e){return t<>>32-e}e.RIPEMD160=o._createHelper(d),e.HmacRIPEMD160=o._createHmacHelper(d)}(Math),r.RIPEMD160)},2783:function(t,e,n){var r,i,o,a,s,c,l,u;t.exports=(i=(r=u=n(8249)).lib,o=i.WordArray,a=i.Hasher,s=r.algo,c=[],l=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=0;l<80;l++){if(l<16)c[l]=0|t[e+l];else{var u=c[l-3]^c[l-8]^c[l-14]^c[l-16];c[l]=u<<1|u>>>31}var f=(r<<5|r>>>27)+s+c[l];f+=l<20?1518500249+(i&o|~i&a):l<40?1859775393+(i^o^a):l<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(r+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),r.SHA1=a._createHelper(l),r.HmacSHA1=a._createHmacHelper(l),u.SHA1)},7792:function(t,e,n){var r,i,o,a,s,c;t.exports=(c=n(8249),n(2153),i=(r=c).lib.WordArray,o=r.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=4,t}}),r.SHA224=a._createHelper(s),r.HmacSHA224=a._createHmacHelper(s),c.SHA224)},2153:function(t,e,n){var r;t.exports=(r=n(8249),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.algo,s=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),c[i]=n(t.pow(r,1/3)),i++),r++}();var l=[],u=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],h=n[7],d=0;d<64;d++){if(d<16)l[d]=0|t[e+d];else{var p=l[d-15],m=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=l[d-2],g=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;l[d]=m+l[d-7]+g+l[d-16]}var y=r&i^r&o^i&o,_=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),b=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&u^~s&f)+c[d]+l[d];h=f,f=u,u=s,s=a+b|0,a=o,o=i,i=r,r=b+(_+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+u|0,n[6]=n[6]+f|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(u),e.HmacSHA256=o._createHmacHelper(u)}(Math),r.SHA256)},3327:function(t,e,n){var r;t.exports=(r=n(8249),n(4938),function(t){var e=r,n=e.lib,i=n.WordArray,o=n.Hasher,a=e.x64.Word,s=e.algo,c=[],l=[],u=[];!function(){for(var t=1,e=0,n=0;n<24;n++){c[t+5*e]=(n+1)*(n+2)/2%64;var r=(2*t+3*e)%5;t=e%5,e=r}for(t=0;t<5;t++)for(e=0;e<5;e++)l[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,f=0,h=0;h<7;h++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(C=n[i]).high^=a,C.low^=o}for(var s=0;s<24;s++){for(var h=0;h<5;h++){for(var d=0,p=0,m=0;m<5;m++)d^=(C=n[h+5*m]).high,p^=C.low;var v=f[h];v.high=d,v.low=p}for(h=0;h<5;h++){var g=f[(h+4)%5],y=f[(h+1)%5],_=y.high,b=y.low;for(d=g.high^(_<<1|b>>>31),p=g.low^(b<<1|_>>>31),m=0;m<5;m++)(C=n[h+5*m]).high^=d,C.low^=p}for(var w=1;w<25;w++){var E=(C=n[w]).high,S=C.low,R=c[w];R<32?(d=E<>>32-R,p=S<>>32-R):(d=S<>>64-R,p=E<>>64-R);var x=f[l[w]];x.high=d,x.low=p}var k=f[0],O=n[0];for(k.high=O.high,k.low=O.low,h=0;h<5;h++)for(m=0;m<5;m++){var C=n[w=h+5*m],A=f[w],L=f[(h+1)%5+5*m],B=f[(h+2)%5+5*m];C.high=A.high^~L.high&B.high,C.low=A.low^~L.low&B.low}C=n[0];var j=u[s];C.high^=j.high,C.low^=j.low}},_doFinalize:function(){var e=this._data,n=e.words,r=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,l=[],u=0;u>>24)|4278255360&(h<<24|h>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),l.push(d),l.push(h)}return new i.init(l,s)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),n=0;n<25;n++)e[n]=e[n].clone();return t}});e.SHA3=o._createHelper(h),e.HmacSHA3=o._createHmacHelper(h)}(Math),r.SHA3)},7460:function(t,e,n){var r,i,o,a,s,c,l,u;t.exports=(u=n(8249),n(4938),n(34),i=(r=u).x64,o=i.Word,a=i.WordArray,s=r.algo,c=s.SHA512,l=s.SHA384=c.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var t=c._doFinalize.call(this);return t.sigBytes-=16,t}}),r.SHA384=c._createHelper(l),r.HmacSHA384=c._createHmacHelper(l),u.SHA384)},34:function(t,e,n){var r;t.exports=(r=n(8249),n(4938),function(){var t=r,e=t.lib.Hasher,n=t.x64,i=n.Word,o=n.WordArray,a=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];!function(){for(var t=0;t<80;t++)l[t]=s()}();var u=a.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],u=n[5],f=n[6],h=n[7],d=r.high,p=r.low,m=i.high,v=i.low,g=o.high,y=o.low,_=a.high,b=a.low,w=s.high,E=s.low,S=u.high,R=u.low,x=f.high,k=f.low,O=h.high,C=h.low,A=d,L=p,B=m,j=v,N=g,P=y,z=_,T=b,I=w,D=E,M=S,F=R,H=x,W=k,U=O,q=C,V=0;V<80;V++){var G,Y,J=l[V];if(V<16)Y=J.high=0|t[e+2*V],G=J.low=0|t[e+2*V+1];else{var K=l[V-15],X=K.high,$=K.low,Z=(X>>>1|$<<31)^(X>>>8|$<<24)^X>>>7,Q=($>>>1|X<<31)^($>>>8|X<<24)^($>>>7|X<<25),tt=l[V-2],et=tt.high,nt=tt.low,rt=(et>>>19|nt<<13)^(et<<3|nt>>>29)^et>>>6,it=(nt>>>19|et<<13)^(nt<<3|et>>>29)^(nt>>>6|et<<26),ot=l[V-7],at=ot.high,st=ot.low,ct=l[V-16],lt=ct.high,ut=ct.low;Y=(Y=(Y=Z+at+((G=Q+st)>>>0>>0?1:0))+rt+((G+=it)>>>0>>0?1:0))+lt+((G+=ut)>>>0>>0?1:0),J.high=Y,J.low=G}var ft,ht=I&M^~I&H,dt=D&F^~D&W,pt=A&B^A&N^B&N,mt=L&j^L&P^j&P,vt=(A>>>28|L<<4)^(A<<30|L>>>2)^(A<<25|L>>>7),gt=(L>>>28|A<<4)^(L<<30|A>>>2)^(L<<25|A>>>7),yt=(I>>>14|D<<18)^(I>>>18|D<<14)^(I<<23|D>>>9),_t=(D>>>14|I<<18)^(D>>>18|I<<14)^(D<<23|I>>>9),bt=c[V],wt=bt.high,Et=bt.low,St=U+yt+((ft=q+_t)>>>0>>0?1:0),Rt=gt+mt;U=H,q=W,H=M,W=F,M=I,F=D,I=z+(St=(St=(St=St+ht+((ft+=dt)>>>0>>0?1:0))+wt+((ft+=Et)>>>0>>0?1:0))+Y+((ft+=G)>>>0>>0?1:0))+((D=T+ft|0)>>>0>>0?1:0)|0,z=N,T=P,N=B,P=j,B=A,j=L,A=St+(vt+pt+(Rt>>>0>>0?1:0))+((L=ft+Rt|0)>>>0>>0?1:0)|0}p=r.low=p+L,r.high=d+A+(p>>>0>>0?1:0),v=i.low=v+j,i.high=m+B+(v>>>0>>0?1:0),y=o.low=y+P,o.high=g+N+(y>>>0>>0?1:0),b=a.low=b+T,a.high=_+z+(b>>>0>>0?1:0),E=s.low=E+D,s.high=w+I+(E>>>0>>0?1:0),R=u.low=R+F,u.high=S+M+(R>>>0>>0?1:0),k=f.low=k+W,f.high=x+H+(k>>>0>>0?1:0),C=h.low=C+q,h.high=O+U+(C>>>0