File Editor
Directories:
.. (Back)
Files:
view.asset.php
view.css
view.js
view.js.LICENSE.txt
view.rtl.css
Create New File
Create
Edit File: view.js
/*! For license information please see view.js.LICENSE.txt */ (()=>{var i={72730:(i,o,e)=>{"use strict";e.d(o,{C_:()=>r,dv:()=>t});var s=e(3975);const n={USD:.5,AUD:.5,BRL:.5,CAD:.5,CHF:.5,DKK:2.5,EUR:.5,GBP:.3,HKD:4,INR:.5,JPY:50,MXN:10,NOK:3,NZD:.5,PLN:2,SEK:3,SGD:.5};Object.keys(n).map((i=>{const{symbol:o}=(0,s.i)(i);var e;return{value:i,label:o===i?i:`${i} ${e=o,String(e||"").replace(/\.+$/,"")}`}}));function t(i){return n[i]}function r(i,o){if(!i)return null;if("number"==typeof i)return i;let e=i;return s.y[o].grouping&&(e=i.replace(new RegExp("\\"+s.y[o].grouping,"g"),"")),i=parseFloat(e.replace(new RegExp("\\"+s.y[o].decimal,"g"),".")),isNaN(i)?null:i}},72856:(i,o,e)=>{"use strict";e.d(o,{Wu:()=>r});let s="";function n(i){if("https://subscribe.wordpress.com"===i.origin&&i.data){const o=JSON.parse(i.data);if(o&&o.result&&o.result.jwt_token&&(s=o.result.jwt_token,c(s)),o&&"close"===o.action&&s)window.location.reload(!0);else if(o&&"close"===o.action){window.removeEventListener("message",n);document.getElementById("memberships-modal-window").close(),document.body.classList.remove("jetpack-memberships-modal-open")}}}function t(i){i.insertAdjacentHTML("beforeend",'<span class="jetpack-memberships-spinner">\t<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\t\t<path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25" fill="currentColor" />\t\t<path d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z" class="jetpack-memberships-spinner-rotating" fill="currentColor" />\t</svg></span>'),i.addEventListener("click",(o=>{o.preventDefault(),i.classList.add("is-loading"),i.setAttribute("aria-busy","true"),i.setAttribute("aria-live","polite");return function(i){return new Promise((o=>{const e=document.getElementById("memberships-modal-window");e&&document.body.removeChild(e);const s=document.createElement("dialog");s.setAttribute("id","memberships-modal-window"),s.classList.add("jetpack-memberships-modal"),s.classList.add("is-loading");const t=document.createElement("iframe");t.setAttribute("frameborder","0"),t.setAttribute("allowtransparency","true"),t.setAttribute("allowfullscreen","true"),t.addEventListener("load",(function(){document.body.classList.add("jetpack-memberships-modal-open"),s.classList.remove("is-loading"),o()})),t.setAttribute("id","memberships-modal-iframe"),t.innerText="This feature requires inline frames. You have iframes disabled or your browser does not support them.",t.src=i+"&display=alternate&jwt_token="+l();const r=document.querySelector('input[name="lang"]')?.value;r&&(t.src=t.src+"&lang="+r),document.body.appendChild(s),s.appendChild(t),window.addEventListener("message",n,!1),s.showModal()}))}(i.getAttribute("href")).then((()=>{i.classList.remove("is-loading"),i.setAttribute("aria-busy","false")})),i.blur(),!1}))}const r=i=>{Array.prototype.slice.call(document.querySelectorAll(i)).forEach((i=>{if("true"!==i.getAttribute("data-jetpack-memberships-button-initialized")){try{t(i)}catch(i){console.error("Problem setting up Modal",i)}i.setAttribute("data-jetpack-memberships-button-initialized","true")}}))},l=function(){const i=`; ${document.cookie}`.split("; wp-jp-premium-content-session=");if(2===i.length)return i.pop().split(";").shift()},c=function(i){const o=new Date,e=new Date(o.setMonth(o.getMonth()+1));document.cookie=`wp-jp-premium-content-session=${i}; expires=${e.toGMTString()}; path=/`}},79366:(i,o,e)=>{"object"==typeof window&&window.Jetpack_Block_Assets_Base_Url&&(e.p=window.Jetpack_Block_Assets_Base_Url)},3975:(i,o,e)=>{"use strict";e.d(o,{i:()=>n,y:()=>s});const s={AED:{symbol:"د.إ.",grouping:",",decimal:".",precision:2},AFN:{symbol:"؋",grouping:",",decimal:".",precision:2},ALL:{symbol:"Lek",grouping:".",decimal:",",precision:2},AMD:{symbol:"֏",grouping:",",decimal:".",precision:2},ANG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AOA:{symbol:"Kz",grouping:",",decimal:".",precision:2},ARS:{symbol:"$",grouping:".",decimal:",",precision:2},AUD:{symbol:"A$",grouping:",",decimal:".",precision:2},AWG:{symbol:"ƒ",grouping:",",decimal:".",precision:2},AZN:{symbol:"₼",grouping:" ",decimal:",",precision:2},BAM:{symbol:"КМ",grouping:".",decimal:",",precision:2},BBD:{symbol:"Bds$",grouping:",",decimal:".",precision:2},BDT:{symbol:"৳",grouping:",",decimal:".",precision:0},BGN:{symbol:"лв.",grouping:" ",decimal:",",precision:2},BHD:{symbol:"د.ب.",grouping:",",decimal:".",precision:3},BIF:{symbol:"FBu",grouping:",",decimal:".",precision:0},BMD:{symbol:"$",grouping:",",decimal:".",precision:2},BND:{symbol:"$",grouping:".",decimal:",",precision:0},BOB:{symbol:"Bs",grouping:".",decimal:",",precision:2},BRL:{symbol:"R$",grouping:".",decimal:",",precision:2},BSD:{symbol:"$",grouping:",",decimal:".",precision:2},BTC:{symbol:"Ƀ",grouping:",",decimal:".",precision:2},BTN:{symbol:"Nu.",grouping:",",decimal:".",precision:1},BWP:{symbol:"P",grouping:",",decimal:".",precision:2},BYR:{symbol:"р.",grouping:" ",decimal:",",precision:2},BZD:{symbol:"BZ$",grouping:",",decimal:".",precision:2},CAD:{symbol:"C$",grouping:",",decimal:".",precision:2},CDF:{symbol:"FC",grouping:",",decimal:".",precision:2},CHF:{symbol:"CHF",grouping:"'",decimal:".",precision:2},CLP:{symbol:"$",grouping:".",decimal:",",precision:2},CNY:{symbol:"¥",grouping:",",decimal:".",precision:2},COP:{symbol:"$",grouping:".",decimal:",",precision:2},CRC:{symbol:"₡",grouping:".",decimal:",",precision:2},CUC:{symbol:"CUC",grouping:",",decimal:".",precision:2},CUP:{symbol:"$MN",grouping:",",decimal:".",precision:2},CVE:{symbol:"$",grouping:",",decimal:".",precision:2},CZK:{symbol:"Kč",grouping:" ",decimal:",",precision:2},DJF:{symbol:"Fdj",grouping:",",decimal:".",precision:0},DKK:{symbol:"kr.",grouping:"",decimal:",",precision:2},DOP:{symbol:"RD$",grouping:",",decimal:".",precision:2},DZD:{symbol:"د.ج.",grouping:",",decimal:".",precision:2},EGP:{symbol:"ج.م.",grouping:",",decimal:".",precision:2},ERN:{symbol:"Nfk",grouping:",",decimal:".",precision:2},ETB:{symbol:"ETB",grouping:",",decimal:".",precision:2},EUR:{symbol:"€",grouping:".",decimal:",",precision:2},FJD:{symbol:"FJ$",grouping:",",decimal:".",precision:2},FKP:{symbol:"£",grouping:",",decimal:".",precision:2},GBP:{symbol:"£",grouping:",",decimal:".",precision:2},GEL:{symbol:"Lari",grouping:" ",decimal:",",precision:2},GHS:{symbol:"₵",grouping:",",decimal:".",precision:2},GIP:{symbol:"£",grouping:",",decimal:".",precision:2},GMD:{symbol:"D",grouping:",",decimal:".",precision:2},GNF:{symbol:"FG",grouping:",",decimal:".",precision:0},GTQ:{symbol:"Q",grouping:",",decimal:".",precision:2},GYD:{symbol:"G$",grouping:",",decimal:".",precision:2},HKD:{symbol:"HK$",grouping:",",decimal:".",precision:2},HNL:{symbol:"L.",grouping:",",decimal:".",precision:2},HRK:{symbol:"kn",grouping:".",decimal:",",precision:2},HTG:{symbol:"G",grouping:",",decimal:".",precision:2},HUF:{symbol:"Ft",grouping:".",decimal:",",precision:0},IDR:{symbol:"Rp",grouping:".",decimal:",",precision:0},ILS:{symbol:"₪",grouping:",",decimal:".",precision:2},INR:{symbol:"₹",grouping:",",decimal:".",precision:2},IQD:{symbol:"د.ع.",grouping:",",decimal:".",precision:2},IRR:{symbol:"﷼",grouping:",",decimal:"/",precision:2},ISK:{symbol:"kr.",grouping:".",decimal:",",precision:0},JMD:{symbol:"J$",grouping:",",decimal:".",precision:2},JOD:{symbol:"د.ا.",grouping:",",decimal:".",precision:3},JPY:{symbol:"¥",grouping:",",decimal:".",precision:0},KES:{symbol:"S",grouping:",",decimal:".",precision:2},KGS:{symbol:"сом",grouping:" ",decimal:"-",precision:2},KHR:{symbol:"៛",grouping:",",decimal:".",precision:0},KMF:{symbol:"CF",grouping:",",decimal:".",precision:2},KPW:{symbol:"₩",grouping:",",decimal:".",precision:0},KRW:{symbol:"₩",grouping:",",decimal:".",precision:0},KWD:{symbol:"د.ك.",grouping:",",decimal:".",precision:3},KYD:{symbol:"$",grouping:",",decimal:".",precision:2},KZT:{symbol:"₸",grouping:" ",decimal:"-",precision:2},LAK:{symbol:"₭",grouping:",",decimal:".",precision:0},LBP:{symbol:"ل.ل.",grouping:",",decimal:".",precision:2},LKR:{symbol:"₨",grouping:",",decimal:".",precision:0},LRD:{symbol:"L$",grouping:",",decimal:".",precision:2},LSL:{symbol:"M",grouping:",",decimal:".",precision:2},LYD:{symbol:"د.ل.",grouping:",",decimal:".",precision:3},MAD:{symbol:"د.م.",grouping:",",decimal:".",precision:2},MDL:{symbol:"lei",grouping:",",decimal:".",precision:2},MGA:{symbol:"Ar",grouping:",",decimal:".",precision:0},MKD:{symbol:"ден.",grouping:".",decimal:",",precision:2},MMK:{symbol:"K",grouping:",",decimal:".",precision:2},MNT:{symbol:"₮",grouping:" ",decimal:",",precision:2},MOP:{symbol:"MOP$",grouping:",",decimal:".",precision:2},MRO:{symbol:"UM",grouping:",",decimal:".",precision:2},MTL:{symbol:"₤",grouping:",",decimal:".",precision:2},MUR:{symbol:"₨",grouping:",",decimal:".",precision:2},MVR:{symbol:"MVR",grouping:",",decimal:".",precision:1},MWK:{symbol:"MK",grouping:",",decimal:".",precision:2},MXN:{symbol:"MX$",grouping:",",decimal:".",precision:2},MYR:{symbol:"RM",grouping:",",decimal:".",precision:2},MZN:{symbol:"MT",grouping:",",decimal:".",precision:0},NAD:{symbol:"N$",grouping:",",decimal:".",precision:2},NGN:{symbol:"₦",grouping:",",decimal:".",precision:2},NIO:{symbol:"C$",grouping:",",decimal:".",precision:2},NOK:{symbol:"kr",grouping:" ",decimal:",",precision:2},NPR:{symbol:"₨",grouping:",",decimal:".",precision:2},NZD:{symbol:"NZ$",grouping:",",decimal:".",precision:2},OMR:{symbol:"﷼",grouping:",",decimal:".",precision:3},PAB:{symbol:"B/.",grouping:",",decimal:".",precision:2},PEN:{symbol:"S/.",grouping:",",decimal:".",precision:2},PGK:{symbol:"K",grouping:",",decimal:".",precision:2},PHP:{symbol:"₱",grouping:",",decimal:".",precision:2},PKR:{symbol:"₨",grouping:",",decimal:".",precision:2},PLN:{symbol:"zł",grouping:" ",decimal:",",precision:2},PYG:{symbol:"₲",grouping:".",decimal:",",precision:2},QAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},RON:{symbol:"lei",grouping:".",decimal:",",precision:2},RSD:{symbol:"Дин.",grouping:".",decimal:",",precision:2},RUB:{symbol:"₽",grouping:" ",decimal:",",precision:2},RWF:{symbol:"RWF",grouping:" ",decimal:",",precision:2},SAR:{symbol:"﷼",grouping:",",decimal:".",precision:2},SBD:{symbol:"S$",grouping:",",decimal:".",precision:2},SCR:{symbol:"₨",grouping:",",decimal:".",precision:2},SDD:{symbol:"LSd",grouping:",",decimal:".",precision:2},SDG:{symbol:"£",grouping:",",decimal:".",precision:2},SEK:{symbol:"kr",grouping:",",decimal:".",precision:2},SGD:{symbol:"S$",grouping:",",decimal:".",precision:2},SHP:{symbol:"£",grouping:",",decimal:".",precision:2},SLL:{symbol:"Le",grouping:",",decimal:".",precision:2},SOS:{symbol:"S",grouping:",",decimal:".",precision:2},SRD:{symbol:"$",grouping:",",decimal:".",precision:2},STD:{symbol:"Db",grouping:",",decimal:".",precision:2},SVC:{symbol:"₡",grouping:",",decimal:".",precision:2},SYP:{symbol:"£",grouping:",",decimal:".",precision:2},SZL:{symbol:"E",grouping:",",decimal:".",precision:2},THB:{symbol:"฿",grouping:",",decimal:".",precision:2},TJS:{symbol:"TJS",grouping:" ",decimal:";",precision:2},TMT:{symbol:"m",grouping:" ",decimal:",",precision:0},TND:{symbol:"د.ت.",grouping:",",decimal:".",precision:3},TOP:{symbol:"T$",grouping:",",decimal:".",precision:2},TRY:{symbol:"TL",grouping:".",decimal:",",precision:2},TTD:{symbol:"TT$",grouping:",",decimal:".",precision:2},TVD:{symbol:"$T",grouping:",",decimal:".",precision:2},TWD:{symbol:"NT$",grouping:",",decimal:".",precision:2},TZS:{symbol:"TSh",grouping:",",decimal:".",precision:2},UAH:{symbol:"₴",grouping:" ",decimal:",",precision:2},UGX:{symbol:"USh",grouping:",",decimal:".",precision:2},USD:{symbol:"$",grouping:",",decimal:".",precision:2},UYU:{symbol:"$U",grouping:".",decimal:",",precision:2},UZS:{symbol:"сўм",grouping:" ",decimal:",",precision:2},VEB:{symbol:"Bs.",grouping:",",decimal:".",precision:2},VEF:{symbol:"Bs. F.",grouping:".",decimal:",",precision:2},VND:{symbol:"₫",grouping:".",decimal:",",precision:1},VUV:{symbol:"VT",grouping:",",decimal:".",precision:0},WST:{symbol:"WS$",grouping:",",decimal:".",precision:2},XAF:{symbol:"F",grouping:",",decimal:".",precision:2},XCD:{symbol:"$",grouping:",",decimal:".",precision:2},XOF:{symbol:"F",grouping:" ",decimal:",",precision:2},XPF:{symbol:"F",grouping:",",decimal:".",precision:2},YER:{symbol:"﷼",grouping:",",decimal:".",precision:2},ZAR:{symbol:"R",grouping:" ",decimal:",",precision:2},ZMW:{symbol:"ZK",grouping:",",decimal:".",precision:2},WON:{symbol:"₩",grouping:",",decimal:".",precision:2}};function n(i){return s[i]||{symbol:"$",grouping:",",decimal:".",precision:2}}},4567:(i,o,e)=>{"use strict";e.d(o,{Ay:()=>t});var s=e(3975),n=e(18360);function t(i,o,e={}){const t=(0,s.i)(o);if(!t||isNaN(i))return null;const{decimal:r,grouping:l,precision:c,symbol:m}={...t,...e},a=i<0?"-":"";let p=(0,n.A)(Math.abs(i),c,r,l);return e.stripZeros&&(p=function(i,o){const e=new RegExp(`\\${o}0+$`);return i.replace(e,"")}(p,r)),`${a}${m}${p}`}},18360:(i,o,e)=>{"use strict";function s(i,o=0,e=".",s=","){const n=(i+"").replace(/[^0-9+\-Ee.]/g,""),t=isFinite(+n)?+n:0,r=isFinite(+o)?Math.abs(o):0,l=(r?function(i,o){const e=Math.pow(10,o);return""+(Math.round(i*e)/e).toFixed(o)}(t,r):""+Math.round(t)).split(".");return l[0].length>3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,s)),(l[1]||"").length<r&&(l[1]=l[1]||"",l[1]+=new Array(r-l[1].length+1).join("0")),l.join(e)}e.d(o,{A:()=>s})},98490:i=>{"use strict";i.exports=window.wp.domReady},93832:i=>{"use strict";i.exports=window.wp.url}},o={};function e(s){var n=o[s];if(void 0!==n)return n.exports;var t=o[s]={exports:{}};return i[s](t,t.exports,e),t.exports}e.n=i=>{var o=i&&i.__esModule?()=>i.default:()=>i;return e.d(o,{a:o}),o},e.d=(i,o)=>{for(var s in o)e.o(o,s)&&!e.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:o[s]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(i){if("object"==typeof window)return window}}(),e.o=(i,o)=>Object.prototype.hasOwnProperty.call(i,o),(()=>{var i;e.g.importScripts&&(i=e.g.location+"");var o=e.g.document;if(!i&&o&&(o.currentScript&&"SCRIPT"===o.currentScript.tagName.toUpperCase()&&(i=o.currentScript.src),!i)){var s=o.getElementsByTagName("script");if(s.length)for(var n=s.length-1;n>-1&&(!i||!/^http(s?):/.test(i));)i=s[n--].src}if(!i)throw new Error("Automatic publicPath is not supported in this browser");i=i.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),e.p=i+"../"})(),(()=>{"use strict";e(79366)})(),(()=>{"use strict";var i=e(4567),o=e(98490),s=e.n(o),n=e(93832),t=e(72730),r=e(72856);class l{constructor(i){this.block=i,this.amount=null,this.isCustomAmount=!1,this.interval="one-time",this.initNavigation(),this.handleCustomAmount(),this.handleChosenAmount(),this.block.querySelector(".donations__container").classList.add("loaded")}getNavItem(i){return this.block.querySelector(`.donations__nav-item[data-interval="${i}"]`)}resetSelectedAmount(){const i=this.block.querySelector(".donations__amount.is-selected");i&&i.classList.remove("is-selected")}getDonateButton(){return this.block.querySelector(`.donations__donate-button.${{"one-time":"donations__one-time-item","1 month":"donations__monthly-item","1 year":"donations__annual-item"}[this.interval]}`)}toggleDonateButton(i){const o=this.getDonateButton();i?o.classList.remove("is-disabled"):o.classList.add("is-disabled")}updateUrl(){const i=this.getDonateButton(),o=i.getAttribute("href");this.amount?i.setAttribute("href",(0,n.addQueryArgs)(o,{amount:this.amount,...this.isCustomAmount&&{customAmount:!0}})):i.setAttribute("href",(0,n.removeQueryArgs)(o,"amount","customAmount"))}updateAmountFromCustomAmountInput(){const i=this.block.querySelector(".donations__custom-amount .donations__amount-value"),o=i.innerHTML;if(!o)return this.amount=null,void this.toggleDonateButton(!1);const e=i.dataset.currency,s=(0,t.C_)(o,e),n=this.block.querySelector(".donations__custom-amount");s&&s>=(0,t.dv)(e)?(n.classList.remove("has-error"),this.amount=s,this.toggleDonateButton(!0)):(n.classList.add("has-error"),this.amount=null,this.toggleDonateButton(!1)),this.updateUrl()}initNavigation(){const i=this.block.querySelectorAll(".donations__nav-item"),o=this.block.querySelector(".donations__tab"),e={"one-time":"is-one-time","1 month":"is-monthly","1 year":"is-annual"},s=i=>{const s=this.interval,n=i.target.dataset.interval;this.interval=n;const t=this.getNavItem(s);t&&t.classList.remove("is-active");const r=this.getNavItem(n);r&&r.classList.add("is-active"),o.classList.remove(e[s]),o.classList.add(e[n]),this.amount=null,this.isCustomAmount=!1,this.resetSelectedAmount(),this.updateUrl(),this.toggleDonateButton(!1)};i.forEach((i=>{i.addEventListener("click",s),i.addEventListener("keydown",s)}));const n=this.getNavItem(this.interval);n&&n.classList.add("is-active"),o.classList.add(e[this.interval])}handleCustomAmount(){const o=this.block.querySelector(".donations__custom-amount .donations__amount-value");if(!o)return;const e=this.block.querySelector(".donations__custom-amount");o.setAttribute("contenteditable",""),o.addEventListener("keydown",(i=>{"Enter"===i.key&&i.preventDefault()})),o.addEventListener("focus",(()=>{this.resetSelectedAmount(),e.classList.add("is-selected"),this.isCustomAmount||(this.isCustomAmount=!0,this.updateAmountFromCustomAmountInput())})),o.addEventListener("blur",(()=>{this.isCustomAmount&&this.amount&&(o.innerHTML=(0,i.Ay)(this.amount,o.dataset.currency,{symbol:""}))})),o.addEventListener("input",(()=>this.updateAmountFromCustomAmountInput()))}handleChosenAmount(){this.block.querySelectorAll(".donations__amount:not( .donations__custom-amount )").forEach((i=>{i.addEventListener("click",(i=>{this.resetSelectedAmount(),i.target.classList.add("is-selected"),this.amount=i.target.dataset.amount,this.isCustomAmount=!1;const o=this.block.querySelector(".donations__custom-amount");o&&o.classList.remove("has-error"),this.updateUrl();this.getDonateButton().classList.remove("is-disabled")}))})),this.block.querySelectorAll(".donations__donate-button").forEach((i=>i.classList.add("is-disabled")))}}s()((()=>{document.querySelectorAll(".wp-block-jetpack-donations").forEach((i=>new l(i))),(0,r.Wu)(".donations__donate-button")}))})()})();
Save Changes
Rename File
Rename