securityos/node_modules/milkdrop-preset-utils/dist/milkdrop-preset-utils.min.js

9 lines
83 KiB
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("milkdropPresetUtils",[],t):"object"==typeof exports?exports.milkdropPresetUtils=t():n.milkdropPresetUtils=t()}("undefined"!=typeof self?self:this,function(){return function(n){var t={};function r(e){if(t[e])return t[e].exports;var u=t[e]={i:e,l:!1,exports:{}};return n[e].call(u.exports,u,u.exports,r),u.l=!0,u.exports}return r.m=n,r.c=t,r.d=function(n,t,e){r.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:e})},r.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(t,"a",t),t},r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.p="",r(r.s=0)}([function(n,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.splitPreset=function(n){for(var t=function(n){return e.default.includes(n,"MILKDROP_PRESET_VERSION=201")?2:1}(n),r=function(n){var t=e.default.split(n,"\n");return[e.default.join(e.default.takeWhile(t,function(n){return!s(n)}),"\n"),e.default.join(e.default.dropWhile(t,function(n){return!s(n)}),"\n")]}(n),u=e.default.split(r[0],"\n"),v=e.default.split(r[1],"\n"),h=f(c(u),i),d=function(n){return l(n,"warp")}(v),g=function(n){return l(n,"comp")}(v),m=function(n){return l(n,"per_frame_init")}(v),y=function(n){return l(n,"per_frame")}(v),b=function(n){return l(n,"per_pixel")}(v),w=[],x=0;x<4;x++){var q="shapecode_"+x+"_",j="shape_"+x+"_init",z="shape_"+x+"_per_frame",k=p(v,q);(k=f(k,a)).enabled?w.push({baseVals:k,init_eqs_str:_(v,j),frame_eqs_str:_(v,z)}):w.push({baseVals:{enabled:0}})}for(var E=[],O=0;O<4;O++){var A="wavecode_"+O+"_",I="wave_"+O+"_init",R="wave_"+O+"_per_frame",D="wave_"+O+"_per_point",W=p(v,A);0!==(W=f(W,o)).enabled?E.push({baseVals:W,init_eqs_str:_(v,I),frame_eqs_str:_(v,R),point_eqs_str:_(v,D)}):E.push({baseVals:{enabled:0}})}return{presetVersion:t,baseVals:h,presetInit:m,perFrame:y,perVertex:b,waves:E,shapes:w,warp:d,comp:g}},t.createBasePresetFuns=function(n,t,r){var u={shapes:[],waves:[]};u.init_eqs_str=n.perFrameInitEQs?n.perFrameInitEQs.trim():"",u.frame_eqs_str=n.perFrameEQs?n.perFrameEQs.trim():"",u.pixel_eqs_str=n.perPixelEQs?n.perPixelEQs.trim():"";for(var i=0;i<n.shapes.length;i++)0!==t[i].baseVals.enabled?u.shapes.push(e.default.assign({},t[i],{init_eqs_str:n.shapes[i].perFrameInitEQs?n.shapes[i].perFrameInitEQs:"",frame_eqs_str:n.shapes[i].perFrameEQs?n.shapes[i].perFrameEQs:""})):u.shapes.push(t[i]);for(var a=0;a<n.waves.length;a++)0!==r[a].baseVals.enabled?u.waves.push(e.default.assign({},r[a],{init_eqs_str:n.waves[a].perFrameInitEQs?n.waves[a].perFrameInitEQs:"",frame_eqs_str:n.waves[a].perFrameEQs?n.waves[a].perFrameEQs:"",point_eqs_str:n.waves[a].perPointEQs?n.waves[a].perPointEQs:""})):u.waves.push(r[a]);return u},t.getShaderParts=v,t.prepareShader=function(n){if(0===n.length)return"";var t=e.default.replace(n,"sampler sampler_pw_noise_lq;\n","");t=e.default.replace(t,"sampler2D sampler_pw_noise_lq;\n",""),t=e.default.replace(t,"sampler sampler_pw_noise_hq;\n","");var r=v(t=e.default.replace(t,"sampler2D sampler_pw_noise_hq;\n",""));return"#define M_PI 3.14159265359\n #define M_PI_2 6.28318530718\n #define M_INV_PI_2 0.159154943091895\n\n uniform sampler2D sampler_main;\n uniform sampler2D sampler_fw_main;\n uniform sampler2D sampler_pw_main;\n uniform sampler2D sampler_fc_main;\n uniform sampler2D sampler_pc_main;\n\n uniform sampler2D sampler_noise_lq;\n uniform sampler2D sampler_noise_lq_lite;\n uniform sampler2D sampler_noise_mq;\n uniform sampler2D sampler_noise_hq;\n uniform sampler3D sampler_noisevol_lq;\n uniform sampler3D sampler_noisevol_hq;\n\n uniform sampler2D sampler_pw_noise_lq;\n\n uniform sampler2D sampler_blur1;\n uniform sampler2D sampler_blur2;\n uniform sampler2D sampler_blur3;\n\n float4 texsize_noise_lq;\n float4 texsize_noise_mq;\n float4 texsize_noise_hq;\n float4 texsize_noise_lq_lite;\n float4 texsize_noisevol_lq;\n float4 texsize_noisevol_hq;\n\n float4 _qa;\n float4 _qb;\n fl
/**
* @license
* Lodash <https://lodash.com/>
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/(function(){var i,a=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",l="__lodash_hash_undefined__",c=500,s="__lodash_placeholder__",_=1,p=2,v=4,h=1,d=2,g=1,m=2,y=4,b=8,w=16,x=32,q=64,j=128,z=256,k=512,E=30,O="...",A=800,I=16,R=1,D=2,W=1/0,S=9007199254740991,C=1.7976931348623157e308,L=NaN,P=4294967295,F=P-1,T=P>>>1,U=[["ary",j],["bind",g],["bindKey",m],["curry",b],["curryRight",w],["flip",k],["partial",x],["partialRight",q],["rearg",z]],B="[object Arguments]",M="[object Array]",$="[object AsyncFunction]",N="[object Boolean]",V="[object Date]",Q="[object DOMException]",Z="[object Error]",G="[object Function]",K="[object GeneratorFunction]",X="[object Map]",H="[object Number]",J="[object Null]",Y="[object Object]",nn="[object Proxy]",tn="[object RegExp]",rn="[object Set]",en="[object String]",un="[object Symbol]",an="[object Undefined]",on="[object WeakMap]",fn="[object WeakSet]",ln="[object ArrayBuffer]",cn="[object DataView]",sn="[object Float32Array]",_n="[object Float64Array]",pn="[object Int8Array]",vn="[object Int16Array]",hn="[object Int32Array]",dn="[object Uint8Array]",gn="[object Uint8ClampedArray]",mn="[object Uint16Array]",yn="[object Uint32Array]",bn=/\b__p \+= '';/g,wn=/\b(__p \+=) '' \+/g,xn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,qn=/&(?:amp|lt|gt|quot|#39);/g,jn=/[&<>"']/g,zn=RegExp(qn.source),kn=RegExp(jn.source),En=/<%-([\s\S]+?)%>/g,On=/<%([\s\S]+?)%>/g,An=/<%=([\s\S]+?)%>/g,In=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rn=/^\w*$/,Dn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Wn=/[\\^$.*+?()[\]{}|]/g,Sn=RegExp(Wn.source),Cn=/^\s+|\s+$/g,Ln=/^\s+/,Pn=/\s+$/,Fn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Tn=/\{\n\/\* \[wrapped with (.+)\] \*/,Un=/,? & /,Bn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Mn=/\\(\\)?/g,$n=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nn=/\w*$/,Vn=/^[-+]0x[0-9a-f]+$/i,Qn=/^0b[01]+$/i,Zn=/^\[object .+?Constructor\]$/,Gn=/^0o[0-7]+$/i,Kn=/^(?:0|[1-9]\d*)$/,Xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hn=/($^)/,Jn=/['\n\r\u2028\u2029\\]/g,Yn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",nt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",tt="[\\ud800-\\udfff]",rt="["+nt+"]",et="["+Yn+"]",ut="\\d+",it="[\\u2700-\\u27bf]",at="[a-z\\xdf-\\xf6\\xf8-\\xff]",ot="[^\\ud800-\\udfff"+nt+ut+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",ft="\\ud83c[\\udffb-\\udfff]",lt="[^\\ud800-\\udfff]",ct="(?:\\ud83c[\\udde6-\\uddff]){2}",st="[\\ud800-\\udbff][\\udc00-\\udfff]",_t="[A-Z\\xc0-\\xd6\\xd8-\\xde]",pt="(?:"+at+"|"+ot+")",vt="(?:"+_t+"|"+ot+")",ht="(?:"+et+"|"+ft+")"+"?",dt="[\\ufe0e\\ufe0f]?"+ht+("(?:\\u200d(?:"+[lt,ct,st].join("|")+")[\\ufe0e\\ufe0f]?"+ht+")*"),gt="(?:"+[it,ct,st].join("|")+")"+dt,mt="(?:"+[lt+et+"?",et,ct,st,tt].join("|")+")",yt=RegExp("[']","g"),bt=RegExp(et,"g"),wt=RegExp(ft+"(?="+ft+")|"+mt+dt,"g"),xt=RegExp([_t+"?"+at+"+(?:['](?:d|ll|m|re|s|t|ve))?(?="+[rt,_t,"$"].join("|")+")",vt+"+(?:['](?:D|LL|M|RE|S|T|VE))?(?="+[rt,_t+pt,"$"].join("|")+")",_t+"?"+pt+"+(?:['](?:d|ll|m|re|s|t|ve))?",_t+"+(?:['](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ut,gt].join("|"),"g"),qt=RegExp("[\\u200d\\ud800-\\udfff"+Yn+"\\ufe0e\\ufe0f]"),jt=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,zt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],kt=-1,Et={};Et[sn]=Et[_n]=Et[pn]=Et[vn]=Et[hn]=Et[dn]=Et[gn]=Et[mn]=Et[yn]=!0,Et[B]=Et[M]=Et[ln]=Et[N]=Et[cn]=Et[V]=Et[Z]=Et[G]=Et[X]=Et[H]=Et[Y]=Et[tn]=Et[rn]=E