qumra-engine 1.0.53 → 1.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs.js +1 -1
- package/dist/bundle.esm.js +1 -1
- package/package.json +2 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see bundle.cjs.js.LICENSE.txt */
|
|
2
|
-
(()=>{var t={863:(t,e,r)=>{var n=r(93).getGlobal;r(38),t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){if(t){var e=n("app").currency;return"".concat(t.toFixed(2)," ").concat(e.currencySymbol)}return"يجب ان يكون رقم"},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,e){return t-t*(e/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,e,r){return 1===t?e:r},truncate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>e?t.slice(0,e)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")}}},908:(t,e,r)=>{var n=r(93),o=n.getGlobal,i=n.setGlobal,a=r(985).getLocales,c=r(413);t.exports={set:function(t,e){i(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||e},t:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=o("lang")||"ar",n=a(r);return n&&c(n,t)||e}}},99:(t,e,r)=>{function n(t){return n="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},n(t)}function o(){"use strict";o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:A(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function b(){}function w(){}function x(){}var L={};f(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(C([])));E&&E!==r&&i.call(E,u)&&(L=E);var S=x.prototype=b.prototype=Object.create(L);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,a,c,u){var l=h(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function A(e,r,n){var o=v;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=G(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function G(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,G(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function _(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 F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,a(S,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},O(k.prototype),f(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),f(S,s,"Generator"),f(S,u,(function(){return this})),f(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(F),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var a=r(271),c=r(928),u=r(168),l=r(915),s=r(896),f=r(863),p=r(908),h=r(926),v=r(985).setLocales,y=r(93).setGlobal,g=r(91),d=r(426);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(g),function(){var r,n=(r=o().mark((function r(n,i,g){var m,b,w,x,L,j,E,S,O,k,A,G,_,F,T,C,P,N,I,U,q,D,z,X,$,K,R,W,Y,B,H,J,M,V;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(L=e.viewsDirectory,j=c.join(null!=L?L:null==i||null===(m=i.locals)||void 0===m||null===(m=m.app)||void 0===m?void 0:m.themePath,"views"),E=c.join(null!=L?L:null==i||null===(b=i.locals)||void 0===b||null===(b=b.app)||void 0===b?void 0:b.themePath,"locales"),S=n.originalUrl,O=n.protocol,!l(S)){r.next=7;break}return g(),r.abrupt("return");case 7:for(A in k=a.configure(j,{autoescape:!0,express:t,watch:e.watch||!1,noCache:e.noCache||!1}),f)k.addFilter(A,f[A]);for(G in s.existsSync(E)&&s.statSync(E).isDirectory()?s.readdirSync(E).forEach((function(t){if(t.endsWith(".json")){var e=c.basename(t,".json"),r=c.join(E,t);if(s.existsSync(r)){var n=s.readFileSync(r,"utf-8");v(e,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),p)k.addGlobal(G,p[G]);return _=h(S),y("lang",_.language),F="".concat(O,"://").concat(n.get("host")).concat(_.path),T=n.headers["x-forwarded-for"]||n.ip,C=n.get("User-Agent")||"",P=n.get("Referer")||"",N=n.get("Accept-Language")||"",I=Intl.DateTimeFormat().resolvedOptions().timeZone||"",U=new d(C),q=U.getDevice(),D=U.getOS(),z=q.type||"desktop",X="".concat(D.name," ").concat(D.version),console.log("🚀 ~ return ~ fullUrl:",F),$="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(F)),K=n.cookies.token,R={Authorization:K,"Content-Type":"application/json",secretKey:null!==(w=null==i||null===(x=i.locals)||void 0===x||null===(x=x.app)||void 0===x?void 0:x.secretKey)&&void 0!==w?w:e.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":C,Referer:P,"X-Forwarded-For":T,"Accept-Language":N,"X-Device-Type":z,"X-OS":X,"X-Timezone":I},W={headers:R},r.next=31,fetch($,W);case 31:return Y=r.sent,(B=Y.headers.getSetCookie())&&B.forEach((function(t){var e=u(t);Object.keys(e).forEach((function(t){var r=e[t],n=r.value,o=r.attributes;i.cookie(t,n,o)}))})),r.next=36,Y.json();case 36:for(V in H=r.sent,J=H.global,M=H.context,J)Object.hasOwnProperty.call(J,V)&&y(V,J[V]);M.page?i.render(M.page.fileName,{global:J,context:M}):i.render("404",{global:J,context:M});case 40:case"end":return r.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,o){var a=r.apply(t,e);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,e,r){return n.apply(this,arguments)}}()}},91:(t,e,r)=>{var n=r(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,e,r){o(t,e,(function(){r()}))}},93:t=>{var e={};t.exports={getGlobal:function(t,r){var n;return null!==(n=e[t])&&void 0!==n?n:r},setGlobal:function(t,r){e[t]=r}}},985:t=>{var e={};t.exports={getLocales:function(t){return e[t]},setLocales:function(t,r){e[t]=r}}},168:t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.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)?r(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 r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t){var r={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=e(n,1),i=e(o[0].split("="),2),a=i[0],c=i[1];if(a&&c){var u=a.trim(),l=c.trim();r[u]||(r[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var f=e(n[s].split("="),2),p=f[0],h=f[1];p&&(r[u].attributes[p.trim()]=!h||h.trim())}}})),r}},926:t=>{t.exports=function(t){var e={language:"ar",path:null},r=t.match(/^\/([a-z]{2})\/(.*)$/);return r?(e.language=r[1],e.path="/".concat(r[2])):(r=t.match(/^\/([a-z]{2})$/))?(e.language=r[1],e.path="/"):e.path=t,e}},413:t=>{t.exports=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(e){return t.endsWith(e)}))}},38:t=>{"use strict";t.exports=require("dinero.js")},757:t=>{"use strict";t.exports=require("express-fingerprint")},271:t=>{"use strict";t.exports=require("nunjucks")},426:t=>{"use strict";t.exports=require("ua-parser-js")},896:t=>{"use strict";t.exports=require("fs")},928:t=>{"use strict";t.exports=require("path")}},e={},r=function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}(99);module.exports=r})();
|
|
2
|
+
(()=>{var t={863:(t,e,r)=>{var n=r(93).getGlobal;r(38),t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){if(t){var e=n("app").currency;return"".concat(t.toFixed(2)," ").concat(e.currencySymbol)}return"يجب ان يكون رقم"},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,e){return t-t*(e/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,e,r){return 1===t?e:r},truncate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>e?t.slice(0,e)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")},seo:function(){return'<title>متجر تجريبي</title>\n<meta name="description" content="متجر تجريبي - Demo Store">\n<meta name="keywords" content="متجر,تجريبي,-,Demo,Store">\n<meta property="store:published_time" content="2024-08-09T06:03:33+03:00">\n<meta property="og:description" content="متجر تجريبي - Demo Store">\n<meta property="og:title" content="متجر تجريبي">\n<meta property="og:type" content="store">\n<meta property="og:locale" content="ar_AR">\n<meta property=":locale:alternate" content="ar_AR">\n<meta property=":locale:alternate" content="en_US">\n<meta property="og:url" content="https://salla.design/dev-ruj4uvkrq9hz389z">\n<meta property="og:image" content="https://salla-dev.s3.eu-central-1.amazonaws.com/logo/logo-fashion.jpg">\n<meta property="og:image:width" content="600">\n<meta property="og:image:height" content="300">\n<meta name="twitter:description" content="متجر تجريبي - Demo Store">\n<meta name="twitter:image" content="https://salla-dev.s3.eu-central-1.amazonaws.com/logo/logo-fashion.jpg">\n<meta name="twitter:card" content="summary_large_image">\n<meta name="twitter:title" content="متجر تجريبي">\n<meta name="twitter:url" content="https://salla.design/dev-ruj4uvkrq9hz389z">\n<meta name="twitter:site" content="@SallaApp">\n<meta name="twitter:creator" content="@SallaApp">\n<script type="application/ld+json">{"@context":"https://schema.org","@type":"Organization","name":"متجر تجريبي","description":"متجر تجريبي - Demo Store","url":"https://salla.design/dev-ruj4uvkrq9hz389z","logo":"https://salla-dev.s3.eu-central-1.amazonaws.com/logo/logo-fashion.jpg"}<\/script>'}}},908:(t,e,r)=>{var n=r(93),o=n.getGlobal,a=n.setGlobal,i=r(985).getLocales,c=r(413);t.exports={set:function(t,e){a(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||e},t:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=o("lang")||"ar",n=i(r);return n&&c(n,t)||e}}},99:(t,e,r)=>{function n(t){return n="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},n(t)}function o(){"use strict";o=function(){return e};var t,e={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(t){p=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,a=Object.create(o.prototype),c=new q(n||[]);return i(a,"_invoke",{value:k(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var m="suspendedStart",g="suspendedYield",y="executing",v="completed",d={};function w(){}function b(){}function x(){}var j={};p(j,u,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(D([])));S&&S!==r&&a.call(S,u)&&(j=S);var _=x.prototype=w.prototype=Object.create(j);function L(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,i,c,u){var l=h(t[o],t,i);if("throw"!==l.type){var s=l.arg,p=s.value;return p&&"object"==n(p)&&a.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(p).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var o;i(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}})}function k(e,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=z(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?v:g,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function z(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,z(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=h(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function A(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function q(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function D(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(a.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(n(e)+" is not iterable")}return b.prototype=x,i(_,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=p(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,p(t,s,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},L(E.prototype),p(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new E(f(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},L(_),p(_,s,"Generator"),p(_,u,(function(){return this})),p(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,q.prototype={constructor:q,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function c(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var l=r(271),s=r(928),p=r(168),f=r(915),h=r(896),m=r(863),g=r(908),y=r(926),v=r(985).setLocales,d=r(93),w=d.setGlobal,b=(d.getGlobal,r(91)),x=r(426),j=r(898);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(j()),t.use(b),function(){var r,n=(r=o().mark((function r(n,a,c){var u,d,b,j,O,S,_,L,E,k,z,A,P,q,D,G,T,F,U,C,N,I,R,X,$,K,J,W,Y,B,H,M,V,Z,Q,tt,et,rt;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(O=e.viewsDirectory,S=s.join(null!=O?O:null==a||null===(u=a.locals)||void 0===u||null===(u=u.app)||void 0===u?void 0:u.themePath,"views"),_=s.join(null!=O?O:null==a||null===(d=a.locals)||void 0===d||null===(d=d.app)||void 0===d?void 0:d.themePath,"locales"),L=n.originalUrl,E=n.protocol,!f(L)){r.next=7;break}return c(),r.abrupt("return");case 7:for(z in k=l.configure(S,{autoescape:!0,express:t,watch:e.watch||!1,noCache:e.noCache||!1}),m)k.addFilter(z,m[z]);for(A in h.existsSync(_)&&h.statSync(_).isDirectory()?h.readdirSync(_).forEach((function(t){if(t.endsWith(".json")){var e=s.basename(t,".json"),r=s.join(_,t);if(h.existsSync(r)){var n=h.readFileSync(r,"utf-8");v(e,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),g)k.addGlobal(A,g[A]);return P=y(L),w("lang",P.language),q="".concat(E,"://").concat(n.get("host")).concat(P.path),D=n.headers["x-forwarded-for"]||n.ip,G=n.get("User-Agent")||"",T=n.get("Referer")||"",F=n.get("Accept-Language")||"",U=Intl.DateTimeFormat().resolvedOptions().timeZone||"",C=new x(G),N=C.getDevice(),I=C.getOS(),R=N.type||"desktop",X="".concat(I.name," ").concat(I.version),console.log("🚀 ~ return ~ fullUrl:",q),$="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(q)),K=n.cookies.token,J={Authorization:K,"Content-Type":"application/json",secretKey:null!==(b=null==a||null===(j=a.locals)||void 0===j||null===(j=j.app)||void 0===j?void 0:j.secretKey)&&void 0!==b?b:e.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":G,Referer:T,"X-Forwarded-For":D,"Accept-Language":F,"X-Device-Type":R,"X-OS":X,"X-Timezone":U},W={headers:J},r.next=31,fetch($,W);case 31:return Y=r.sent,(B=Y.headers.getSetCookie())&&B.forEach((function(t){var e=p(t);Object.keys(e).forEach((function(t){var r=e[t],n=r.value,o=r.attributes;a.cookie(t,n,o)}))})),r.next=36,Y.json();case 36:for(Z in H=r.sent,M=H.global,V=H.context,M)Object.hasOwnProperty.call(M,Z)&&(console.log("🚀 ~ return ~ key:",Z),console.log("🚀 ~ return ~ global[key]:",M[Z]),w(Z,M[Z]));V.page?(Q=function(t,e){return{content:t,priority:e}},tt=function(t){return t.replace(/<script.*?>.*?<\/script>/gi,"")},et=i({},M),rt={head_scripts:[Q("<script>window.__qumra__ = window.__qumra__ || {}; window.__qumra__.data = ".concat(tt(JSON.stringify(et)),";<\/script>"),15)],seo:[Q("<title>".concat(M.app.name,"</title>")),Q('<meta name="description" content="'.concat(M.app.description,'">')),Q('<meta name="keywords" content="متجر,تجريبي,-,Demo,Store">'),Q('<meta property="store:published_time" content="2024-08-09T06:03:33+03:00">'),Q('<meta property="og:description" content="'.concat(M.app.description,'">')),Q('<meta property="og:title" content="'.concat(M.app.name,'">')),Q('<meta property="og:type" content="store">'),Q('<meta property="og:locale" content="ar_AR">'),Q('<meta property=":locale:alternate" content="ar_AR">'),Q('<meta property=":locale:alternate" content="en_US">'),Q('<meta property="og:url" content="https://salla.design/dev-ruj4uvkrq9hz389z">'),Q('<meta property="og:image" content="'.concat(M.app.logoUrl,'">')),Q('<meta property="og:image:width" content="600">'),Q('<meta property="og:image:height" content="300">'),Q('<meta name="twitter:description" content="'.concat(M.app.description,'">')),Q('<meta name="twitter:image" content="'.concat(M.app.logoUrl,'">')),Q('<meta name="twitter:card" content="summary_large_image">'),Q('<meta name="twitter:title" content="'.concat(M.app.name,'">')),Q('<meta name="twitter:url" content="https://salla.design/dev-ruj4uvkrq9hz389z">'),Q('<meta name="twitter:site" content="@SallaApp">'),Q('<meta name="twitter:creator" content="@SallaApp">'),Q('<script type="application/ld+json">{"@context":"https://schema.org","@type":"Organization","name":"'.concat(M.app.name,'","description":"').concat(M.app.description,'","url":"https://salla.design/dev-ruj4uvkrq9hz389z","logo":"').concat(M.app.logoUrl,'"}<\/script>'))]},Object.keys(rt).forEach((function(t){rt[t]=rt[t].sort((function(t,e){return e.priority-t.priority})).map((function(t){return k.renderString(t.content)})).join("")})),console.log("🚀 ~ Object.keys ~ hooks:",rt),a.render(V.page.fileName,{global:M,context:V,hooks:rt})):a.render("404",{global:M,context:V});case 40:case"end":return r.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,o){var a=r.apply(t,e);function i(t){u(a,n,o,i,c,"next",t)}function c(t){u(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(t,e,r){return n.apply(this,arguments)}}()}},91:(t,e,r)=>{var n=r(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,e,r){o(t,e,(function(){r()}))}},93:t=>{var e={};t.exports={getGlobal:function(t,r){var n;return null!==(n=e[t])&&void 0!==n?n:r},setGlobal:function(t,r){e[t]=r}}},985:t=>{var e={};t.exports={getLocales:function(t){return e[t]},setLocales:function(t,r){e[t]=r}}},168:t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.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)?r(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 r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t){var r={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=e(n,1),a=e(o[0].split("="),2),i=a[0],c=a[1];if(i&&c){var u=i.trim(),l=c.trim();r[u]||(r[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var p=e(n[s].split("="),2),f=p[0],h=p[1];f&&(r[u].attributes[f.trim()]=!h||h.trim())}}})),r}},926:t=>{t.exports=function(t){var e={language:"ar",path:null},r=t.match(/^\/([a-z]{2})\/(.*)$/);return r?(e.language=r[1],e.path="/".concat(r[2])):(r=t.match(/^\/([a-z]{2})$/))?(e.language=r[1],e.path="/"):e.path=t,e}},413:t=>{t.exports=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(e){return t.endsWith(e)}))}},898:t=>{"use strict";t.exports=require("cookie-parser")},38:t=>{"use strict";t.exports=require("dinero.js")},757:t=>{"use strict";t.exports=require("express-fingerprint")},271:t=>{"use strict";t.exports=require("nunjucks")},426:t=>{"use strict";t.exports=require("ua-parser-js")},896:t=>{"use strict";t.exports=require("fs")},928:t=>{"use strict";t.exports=require("path")}},e={},r=function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}(99);module.exports=r})();
|
package/dist/bundle.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see bundle.esm.js.LICENSE.txt */
|
|
2
|
-
import{createRequire as t}from"node:module";var e={863:(t,e,r)=>{var n=r(93).getGlobal;r(38),t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){if(t){var e=n("app").currency;return"".concat(t.toFixed(2)," ").concat(e.currencySymbol)}return"يجب ان يكون رقم"},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,e){return t-t*(e/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,e,r){return 1===t?e:r},truncate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>e?t.slice(0,e)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")}}},908:(t,e,r)=>{var n=r(93),o=n.getGlobal,i=n.setGlobal,a=r(985).getLocales,c=r(413);t.exports={set:function(t,e){i(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||e},t:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=o("lang")||"ar",n=a(r);return n&&c(n,t)||e}}},99:(t,e,r)=>{function n(t){return n="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},n(t)}function o(){o=function(){return e};var t,e={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:A(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var v="suspendedStart",y="suspendedYield",g="executing",d="completed",m={};function b(){}function w(){}function x(){}var L={};f(L,u,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(C([])));E&&E!==r&&i.call(E,u)&&(L=E);var S=x.prototype=b.prototype=Object.create(L);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(o,a,c,u){var l=h(t[o],t,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}})}function A(e,r,n){var o=v;return function(i,a){if(o===g)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=G(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=g;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?d:y,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function G(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,G(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function _(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 F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(i.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=x,a(S,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=f(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},O(k.prototype),f(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new k(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),f(S,s,"Generator"),f(S,u,(function(){return this})),f(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(F),!e)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var a=r(271),c=r(928),u=r(168),l=r(915),s=r(896),f=r(863),p=r(908),h=r(926),v=r(985).setLocales,y=r(93).setGlobal,g=r(91),d=r(426);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(g),function(){var r,n=(r=o().mark((function r(n,i,g){var m,b,w,x,L,j,E,S,O,k,A,G,_,F,T,C,P,N,I,U,D,q,z,R,X,$,K,W,Y,B,H,J,M,V;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(L=e.viewsDirectory,j=c.join(null!=L?L:null==i||null===(m=i.locals)||void 0===m||null===(m=m.app)||void 0===m?void 0:m.themePath,"views"),E=c.join(null!=L?L:null==i||null===(b=i.locals)||void 0===b||null===(b=b.app)||void 0===b?void 0:b.themePath,"locales"),S=n.originalUrl,O=n.protocol,!l(S)){r.next=7;break}return g(),r.abrupt("return");case 7:for(A in k=a.configure(j,{autoescape:!0,express:t,watch:e.watch||!1,noCache:e.noCache||!1}),f)k.addFilter(A,f[A]);for(G in s.existsSync(E)&&s.statSync(E).isDirectory()?s.readdirSync(E).forEach((function(t){if(t.endsWith(".json")){var e=c.basename(t,".json"),r=c.join(E,t);if(s.existsSync(r)){var n=s.readFileSync(r,"utf-8");v(e,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),p)k.addGlobal(G,p[G]);return _=h(S),y("lang",_.language),F="".concat(O,"://").concat(n.get("host")).concat(_.path),T=n.headers["x-forwarded-for"]||n.ip,C=n.get("User-Agent")||"",P=n.get("Referer")||"",N=n.get("Accept-Language")||"",I=Intl.DateTimeFormat().resolvedOptions().timeZone||"",U=new d(C),D=U.getDevice(),q=U.getOS(),z=D.type||"desktop",R="".concat(q.name," ").concat(q.version),console.log("🚀 ~ return ~ fullUrl:",F),X="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(F)),$=n.cookies.token,K={Authorization:$,"Content-Type":"application/json",secretKey:null!==(w=null==i||null===(x=i.locals)||void 0===x||null===(x=x.app)||void 0===x?void 0:x.secretKey)&&void 0!==w?w:e.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":C,Referer:P,"X-Forwarded-For":T,"Accept-Language":N,"X-Device-Type":z,"X-OS":R,"X-Timezone":I},W={headers:K},r.next=31,fetch(X,W);case 31:return Y=r.sent,(B=Y.headers.getSetCookie())&&B.forEach((function(t){var e=u(t);Object.keys(e).forEach((function(t){var r=e[t],n=r.value,o=r.attributes;i.cookie(t,n,o)}))})),r.next=36,Y.json();case 36:for(V in H=r.sent,J=H.global,M=H.context,J)Object.hasOwnProperty.call(J,V)&&y(V,J[V]);M.page?i.render(M.page.fileName,{global:J,context:M}):i.render("404",{global:J,context:M});case 40:case"end":return r.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,o){var a=r.apply(t,e);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(t,e,r){return n.apply(this,arguments)}}()}},91:(t,e,r)=>{var n=r(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,e,r){o(t,e,(function(){r()}))}},93:t=>{var e={};t.exports={getGlobal:function(t,r){var n;return null!==(n=e[t])&&void 0!==n?n:r},setGlobal:function(t,r){e[t]=r}}},985:t=>{var e={};t.exports={getLocales:function(t){return e[t]},setLocales:function(t,r){e[t]=r}}},168:t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.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)?r(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 r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t){var r={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=e(n,1),i=e(o[0].split("="),2),a=i[0],c=i[1];if(a&&c){var u=a.trim(),l=c.trim();r[u]||(r[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var f=e(n[s].split("="),2),p=f[0],h=f[1];p&&(r[u].attributes[p.trim()]=!h||h.trim())}}})),r}},926:t=>{t.exports=function(t){var e={language:"ar",path:null},r=t.match(/^\/([a-z]{2})\/(.*)$/);return r?(e.language=r[1],e.path="/".concat(r[2])):(r=t.match(/^\/([a-z]{2})$/))?(e.language=r[1],e.path="/"):e.path=t,e}},413:t=>{t.exports=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(e){return t.endsWith(e)}))}},38:t=>{t.exports=require("dinero.js")},757:t=>{t.exports=require("express-fingerprint")},271:t=>{t.exports=require("nunjucks")},426:t=>{t.exports=require("ua-parser-js")},896:e=>{e.exports=t(import.meta.url)("fs")},928:e=>{e.exports=t(import.meta.url)("path")}},r={};!function t(n){var o=r[n];if(void 0!==o)return o.exports;var i=r[n]={exports:{}};return e[n](i,i.exports,t),i.exports}(99);
|
|
2
|
+
import{createRequire as t}from"node:module";var e={863:(t,e,r)=>{var n=r(93).getGlobal;r(38),t.exports={upperCase:function(t){return t.toUpperCase()},reverse:function(t){return t.split("").reverse().join("")},capitalize:function(t){return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},formatCurrency:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$")+parseFloat(t).toFixed(2)},money:function(t){if(t){var e=n("app").currency;return"".concat(t.toFixed(2)," ").concat(e.currencySymbol)}return"يجب ان يكون رقم"},date:function(t){return new Date(t).toISOString().split("T")[0]},applyDiscount:function(t,e){return t-t*(e/100)},addVAT:function(t){return t+t*((arguments.length>1&&void 0!==arguments[1]?arguments[1]:15)/100)},pluralize:function(t,e,r){return 1===t?e:r},truncate:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return t.length>e?t.slice(0,e)+"...":t},trimSpaces:function(t){return t.trim()},isEmpty:function(t){return!t||0===t.trim().length},slugify:function(t){return t.toLowerCase().replace(/\s+/g,"-").replace(/[^\w-]+/g,"")},formatNumber:function(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")},assets:function(t){return n("assets")+t},cdn:function(t){return n("cdn")},seo:function(){return'<title>متجر تجريبي</title>\n<meta name="description" content="متجر تجريبي - Demo Store">\n<meta name="keywords" content="متجر,تجريبي,-,Demo,Store">\n<meta property="store:published_time" content="2024-08-09T06:03:33+03:00">\n<meta property="og:description" content="متجر تجريبي - Demo Store">\n<meta property="og:title" content="متجر تجريبي">\n<meta property="og:type" content="store">\n<meta property="og:locale" content="ar_AR">\n<meta property=":locale:alternate" content="ar_AR">\n<meta property=":locale:alternate" content="en_US">\n<meta property="og:url" content="https://salla.design/dev-ruj4uvkrq9hz389z">\n<meta property="og:image" content="https://salla-dev.s3.eu-central-1.amazonaws.com/logo/logo-fashion.jpg">\n<meta property="og:image:width" content="600">\n<meta property="og:image:height" content="300">\n<meta name="twitter:description" content="متجر تجريبي - Demo Store">\n<meta name="twitter:image" content="https://salla-dev.s3.eu-central-1.amazonaws.com/logo/logo-fashion.jpg">\n<meta name="twitter:card" content="summary_large_image">\n<meta name="twitter:title" content="متجر تجريبي">\n<meta name="twitter:url" content="https://salla.design/dev-ruj4uvkrq9hz389z">\n<meta name="twitter:site" content="@SallaApp">\n<meta name="twitter:creator" content="@SallaApp">\n<script type="application/ld+json">{"@context":"https://schema.org","@type":"Organization","name":"متجر تجريبي","description":"متجر تجريبي - Demo Store","url":"https://salla.design/dev-ruj4uvkrq9hz389z","logo":"https://salla-dev.s3.eu-central-1.amazonaws.com/logo/logo-fashion.jpg"}<\/script>'}}},908:(t,e,r)=>{var n=r(93),o=n.getGlobal,a=n.setGlobal,i=r(985).getLocales,c=r(413);t.exports={set:function(t,e){a(t,e)},get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return o(t)||e},t:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=o("lang")||"ar",n=i(r);return n&&c(n,t)||e}}},99:(t,e,r)=>{function n(t){return n="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},n(t)}function o(){o=function(){return e};var t,e={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",l=c.asyncIterator||"@@asyncIterator",s=c.toStringTag||"@@toStringTag";function p(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(t){p=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,a=Object.create(o.prototype),c=new D(n||[]);return i(a,"_invoke",{value:k(t,r,c)}),a}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var m="suspendedStart",g="suspendedYield",y="executing",v="completed",d={};function w(){}function b(){}function x(){}var j={};p(j,u,(function(){return this}));var O=Object.getPrototypeOf,S=O&&O(O(q([])));S&&S!==r&&a.call(S,u)&&(j=S);var _=x.prototype=w.prototype=Object.create(j);function L(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,i,c,u){var l=h(t[o],t,i);if("throw"!==l.type){var s=l.arg,p=s.value;return p&&"object"==n(p)&&a.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,c,u)}),(function(t){r("throw",t,c,u)})):e.resolve(p).then((function(t){s.value=t,c(s)}),(function(t){return r("throw",t,c,u)}))}u(l.arg)}var o;i(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(a,a):a()}})}function k(e,r,n){var o=m;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=z(c,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=h(e,r,n);if("normal"===l.type){if(o=n.done?v:g,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=v,n.method="throw",n.arg=l.arg)}}}function z(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,z(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=h(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function A(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function q(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(a.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(n(e)+" is not iterable")}return b.prototype=x,i(_,"constructor",{value:x,configurable:!0}),i(x,"constructor",{value:b,configurable:!0}),b.displayName=p(x,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,p(t,s,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},L(E.prototype),p(E.prototype,l,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new E(f(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},L(_),p(_,s,"Generator"),p(_,u,(function(){return this})),p(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=q,D.prototype={constructor:D,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(u&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:q(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function a(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function c(t,e,r){return(e=function(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var l=r(271),s=r(928),p=r(168),f=r(915),h=r(896),m=r(863),g=r(908),y=r(926),v=r(985).setLocales,d=r(93),w=d.setGlobal,b=(d.getGlobal,r(91)),x=r(426),j=r(898);t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.use(j()),t.use(b),function(){var r,n=(r=o().mark((function r(n,a,c){var u,d,b,j,O,S,_,L,E,k,z,A,P,D,q,G,T,F,U,C,N,I,R,X,$,K,J,W,Y,B,H,M,V,Z,Q,tt,et,rt;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(O=e.viewsDirectory,S=s.join(null!=O?O:null==a||null===(u=a.locals)||void 0===u||null===(u=u.app)||void 0===u?void 0:u.themePath,"views"),_=s.join(null!=O?O:null==a||null===(d=a.locals)||void 0===d||null===(d=d.app)||void 0===d?void 0:d.themePath,"locales"),L=n.originalUrl,E=n.protocol,!f(L)){r.next=7;break}return c(),r.abrupt("return");case 7:for(z in k=l.configure(S,{autoescape:!0,express:t,watch:e.watch||!1,noCache:e.noCache||!1}),m)k.addFilter(z,m[z]);for(A in h.existsSync(_)&&h.statSync(_).isDirectory()?h.readdirSync(_).forEach((function(t){if(t.endsWith(".json")){var e=s.basename(t,".json"),r=s.join(_,t);if(h.existsSync(r)){var n=h.readFileSync(r,"utf-8");v(e,JSON.parse(n))}}})):console.log("المجلد غير موجود أو أنه ليس مجلدًا."),g)k.addGlobal(A,g[A]);return P=y(L),w("lang",P.language),D="".concat(E,"://").concat(n.get("host")).concat(P.path),q=n.headers["x-forwarded-for"]||n.ip,G=n.get("User-Agent")||"",T=n.get("Referer")||"",F=n.get("Accept-Language")||"",U=Intl.DateTimeFormat().resolvedOptions().timeZone||"",C=new x(G),N=C.getDevice(),I=C.getOS(),R=N.type||"desktop",X="".concat(I.name," ").concat(I.version),console.log("🚀 ~ return ~ fullUrl:",D),$="https://api.qumra.cloud/templateEngine/v1/render?path=".concat(encodeURIComponent(D)),K=n.cookies.token,J={Authorization:K,"Content-Type":"application/json",secretKey:null!==(b=null==a||null===(j=a.locals)||void 0===j||null===(j=j.app)||void 0===j?void 0:j.secretKey)&&void 0!==b?b:e.secretKey,fingerprint:n.fingerprint.hash,"User-Agent":G,Referer:T,"X-Forwarded-For":q,"Accept-Language":F,"X-Device-Type":R,"X-OS":X,"X-Timezone":U},W={headers:J},r.next=31,fetch($,W);case 31:return Y=r.sent,(B=Y.headers.getSetCookie())&&B.forEach((function(t){var e=p(t);Object.keys(e).forEach((function(t){var r=e[t],n=r.value,o=r.attributes;a.cookie(t,n,o)}))})),r.next=36,Y.json();case 36:for(Z in H=r.sent,M=H.global,V=H.context,M)Object.hasOwnProperty.call(M,Z)&&(console.log("🚀 ~ return ~ key:",Z),console.log("🚀 ~ return ~ global[key]:",M[Z]),w(Z,M[Z]));V.page?(Q=function(t,e){return{content:t,priority:e}},tt=function(t){return t.replace(/<script.*?>.*?<\/script>/gi,"")},et=i({},M),rt={head_scripts:[Q("<script>window.__qumra__ = window.__qumra__ || {}; window.__qumra__.data = ".concat(tt(JSON.stringify(et)),";<\/script>"),15)],seo:[Q("<title>".concat(M.app.name,"</title>")),Q('<meta name="description" content="'.concat(M.app.description,'">')),Q('<meta name="keywords" content="متجر,تجريبي,-,Demo,Store">'),Q('<meta property="store:published_time" content="2024-08-09T06:03:33+03:00">'),Q('<meta property="og:description" content="'.concat(M.app.description,'">')),Q('<meta property="og:title" content="'.concat(M.app.name,'">')),Q('<meta property="og:type" content="store">'),Q('<meta property="og:locale" content="ar_AR">'),Q('<meta property=":locale:alternate" content="ar_AR">'),Q('<meta property=":locale:alternate" content="en_US">'),Q('<meta property="og:url" content="https://salla.design/dev-ruj4uvkrq9hz389z">'),Q('<meta property="og:image" content="'.concat(M.app.logoUrl,'">')),Q('<meta property="og:image:width" content="600">'),Q('<meta property="og:image:height" content="300">'),Q('<meta name="twitter:description" content="'.concat(M.app.description,'">')),Q('<meta name="twitter:image" content="'.concat(M.app.logoUrl,'">')),Q('<meta name="twitter:card" content="summary_large_image">'),Q('<meta name="twitter:title" content="'.concat(M.app.name,'">')),Q('<meta name="twitter:url" content="https://salla.design/dev-ruj4uvkrq9hz389z">'),Q('<meta name="twitter:site" content="@SallaApp">'),Q('<meta name="twitter:creator" content="@SallaApp">'),Q('<script type="application/ld+json">{"@context":"https://schema.org","@type":"Organization","name":"'.concat(M.app.name,'","description":"').concat(M.app.description,'","url":"https://salla.design/dev-ruj4uvkrq9hz389z","logo":"').concat(M.app.logoUrl,'"}<\/script>'))]},Object.keys(rt).forEach((function(t){rt[t]=rt[t].sort((function(t,e){return e.priority-t.priority})).map((function(t){return k.renderString(t.content)})).join("")})),console.log("🚀 ~ Object.keys ~ hooks:",rt),a.render(V.page.fileName,{global:M,context:V,hooks:rt})):a.render("404",{global:M,context:V});case 40:case"end":return r.stop()}}),r)})),function(){var t=this,e=arguments;return new Promise((function(n,o){var a=r.apply(t,e);function i(t){u(a,n,o,i,c,"next",t)}function c(t){u(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(t,e,r){return n.apply(this,arguments)}}()}},91:(t,e,r)=>{var n=r(757),o=n({parameters:[n.useragent,n.acceptHeaders,n.geoip]});t.exports=function(t,e,r){o(t,e,(function(){r()}))}},93:t=>{var e={};t.exports={getGlobal:function(t,r){var n;return null!==(n=e[t])&&void 0!==n?n:r},setGlobal:function(t,r){e[t]=r}}},985:t=>{var e={};t.exports={getLocales:function(t){return e[t]},setLocales:function(t,r){e[t]=r}}},168:t=>{function e(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.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)?r(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 r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}t.exports=function(t){var r={};return t.split(/,(?![^\(\)]+\))/).forEach((function(t){var n=t.split(";"),o=e(n,1),a=e(o[0].split("="),2),i=a[0],c=a[1];if(i&&c){var u=i.trim(),l=c.trim();r[u]||(r[u]={value:l,attributes:{}});for(var s=1;s<n.length;s++){var p=e(n[s].split("="),2),f=p[0],h=p[1];f&&(r[u].attributes[f.trim()]=!h||h.trim())}}})),r}},926:t=>{t.exports=function(t){var e={language:"ar",path:null},r=t.match(/^\/([a-z]{2})\/(.*)$/);return r?(e.language=r[1],e.path="/".concat(r[2])):(r=t.match(/^\/([a-z]{2})$/))?(e.language=r[1],e.path="/"):e.path=t,e}},413:t=>{t.exports=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)}},915:t=>{t.exports=function(t){return[".jpg",".jpeg",".png",".webp",".gif",".svg",".js",".css",".woff",".woff2",".ttf",".ico"].some((function(e){return t.endsWith(e)}))}},898:t=>{t.exports=require("cookie-parser")},38:t=>{t.exports=require("dinero.js")},757:t=>{t.exports=require("express-fingerprint")},271:t=>{t.exports=require("nunjucks")},426:t=>{t.exports=require("ua-parser-js")},896:e=>{e.exports=t(import.meta.url)("fs")},928:e=>{e.exports=t(import.meta.url)("path")}},r={};!function t(n){var o=r[n];if(void 0!==o)return o.exports;var a=r[n]={exports:{}};return e[n](a,a.exports,t),a.exports}(99);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qumra-engine",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.54",
|
|
4
4
|
"main": "dist/bundle.cjs.js",
|
|
5
5
|
"module": "dist/bundle.esm.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"description": "",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@rollup/plugin-babel": "^6.0.4",
|
|
16
|
+
"cookie-parser": "^1.4.6",
|
|
16
17
|
"dinero.js": "^1.9.1",
|
|
17
18
|
"express-fingerprint": "^1.2.2",
|
|
18
19
|
"nunjucks": "^3.2.4",
|