@eldrex/papyr-charts 3.0.1

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.
@@ -0,0 +1,613 @@
1
+ (()=>{let l=null,o=!1,d=["html","head","body","title","div","span","p","h1","h2","h3","h4","h5","h6","button","a","img","input","textarea","select","option","optgroup","ul","ol","li","dl","dt","dd","table","thead","tbody","tfoot","tr","td","th","caption","colgroup","col","form","label","fieldset","legend","datalist","output","section","article","header","footer","nav","aside","main","pre","code","hr","br","strong","em","small","mark","sub","sup","i","b","u","s","tt","cite","address","blockquote","audio","video","source","track","picture","embed","iframe","canvas","svg","details","summary","dialog","menu","menuitem","template","slot"],a=null,p=("undefined"==typeof document&&(a={documentElement:{style:{setProperty(){}},setAttribute(){}},body:{appendChild(){},setAttribute(){}},head:{appendChild(){}},createElement(e){return{tagName:e.toUpperCase(),attributes:{},style:{setProperty(e,t){this[e]=t}},classList:{_classes:[],add(e){this._classes.includes(e)||this._classes.push(e)},remove(t){this._classes=this._classes.filter(e=>e!==t)},contains(e){return this._classes.includes(e)}},childNodes:[],appendChild(e){this.childNodes.push(e),e&&"object"==typeof e&&(e.parentNode=this)},insertBefore(e,t){t=this.childNodes.indexOf(t);-1!==t?this.childNodes.splice(t,0,e):this.childNodes.push(e),e&&"object"==typeof e&&(e.parentNode=this)},removeChild(t){this.childNodes=this.childNodes.filter(e=>e!==t)},setAttribute(e,t){this.attributes[e]=t},getAttribute(e){return this.attributes[e]},removeAttribute(e){delete this.attributes[e]},hasAttribute(e){return e in this.attributes},addEventListener(){},removeEventListener(){},get innerHTML(){var e=Object.entries(this.attributes).map(([e,t])=>e+`="${t}"`).join(" "),t=Object.entries(this.style).filter(([e])=>"function"!=typeof this.style[e]).map(([e,t])=>e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+t).join("; "),e=[0<this.classList._classes.length?`class="${this.classList._classes.join(" ")}"`:"",e,t?`style="${t}"`:""].filter(Boolean).join(" "),t=this.childNodes.map(e=>"string"==typeof e?e:e.innerHTML||e.text||"").join("");return`<${this.tagName.toLowerCase()}${e?" "+e:""}>${t}</${this.tagName.toLowerCase()}>`}}},createTextNode(e){return{nodeType:3,text:e,get innerHTML(){return e}}},createDocumentFragment(){return{nodeType:11,childNodes:[],appendChild(e){this.childNodes.push(e)},get innerHTML(){return this.childNodes.map(e=>"string"==typeof e?e:e.innerHTML||e.text||"").join("")}}},querySelector(){return null},getElementById(){return null}}),e=>!(!e||"object"!=typeof e)&&("undefined"!=typeof Element&&e instanceof Element||"undefined"!=typeof DocumentFragment&&e instanceof DocumentFragment||"string"==typeof e.tagName&&"function"==typeof e.appendChild||1===e.nodeType||11===e.nodeType)),c={flex:{display:"flex"},block:{display:"block"},inline:{display:"inline"},"inline-flex":{display:"inline-flex"},grid:{display:"grid"},hidden:{display:"none"},center:{justifyContent:"center",alignItems:"center"},"items-center":{alignItems:"center"},"justify-between":{justifyContent:"space-between"},"flex-col":{flexDirection:"column"},"flex-row":{flexDirection:"row"},"flex-wrap":{flexWrap:"wrap"},"rounded-sm":{borderRadius:"2px"},rounded:{borderRadius:"4px"},"rounded-md":{borderRadius:"6px"},"rounded-lg":{borderRadius:"8px"},"rounded-xl":{borderRadius:"12px"},"rounded-2xl":{borderRadius:"16px"},"rounded-full":{borderRadius:"9999px"},"shadow-sm":{boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)"},shadow:{boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},"shadow-md":{boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)"},"shadow-lg":{boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"},"shadow-xl":{boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)"},"w-full":{width:"100%"},"h-full":{height:"100%"}},t=null,n=()=>{if(!t){if("undefined"==typeof document)return null;let e=null;(e="function"==typeof document.querySelector?document.querySelector("#papyr-dynamic-utilities"):e)||"function"==typeof document.createElement&&((e=document.createElement("style")).id="papyr-dynamic-utilities",document.head)&&"function"==typeof document.head.appendChild&&document.head.appendChild(e),t=e?e.sheet||e:null}return t},i=new Set,u=(t,e)=>{var r=n();if(r){t=t+` { ${e} }`;if(!i.has(t))if(i.add(t),r.insertRule)try{r.insertRule(t,r.cssRules.length)}catch(e){r.textContent+="\n"+t}else r.textContent+="\n"+t}},y=new Map,f=[];class h{constructor(e){this.kernel=e,this.listeners=new Map}on(e,t){this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t)}off(e,t){this.listeners.has(e)&&this.listeners.set(e,this.listeners.get(e).filter(e=>e!==t))}emit(e,t){this.listeners.has(e)&&this.listeners.get(e).forEach(e=>{try{e(t)}catch(e){this.kernel.diagnostics.reportError(e)}})}}class g{constructor(e){this.kernel=e,this.states=new Set}register(e){this.states.add(e)}list(){return Array.from(this.states)}dump(){let t={},r=0;return this.states.forEach(e=>{t["state_"+r++]=e.value}),t}}class m{constructor(e){this.kernel=e,this.registered=new Set}register(e){this.registered.add(e)}list(){return Array.from(this.registered).filter(e=>{if("undefined"!=typeof document){if("function"==typeof document.contains)return document.contains(e);if(document.body&&"function"==typeof document.body.contains)return document.body.contains(e)}return!0}).map(e=>({tag:e.tagName?e.tagName.toLowerCase():"unknown",id:e.id||"",classes:e.className||""}))}}class b{constructor(e){this.kernel=e,this.installed=new Map}register(e){e&&"object"==typeof e&&(this.installed.set(e.name,e),"function"==typeof e.install&&e.install(this.kernel),e.hooks)&&"function"==typeof e.hooks.onInit&&e.hooks.onInit()}resolve(e){return this.installed.get(e)}list(){return Array.from(this.installed.keys()).map(e=>{e=this.installed.get(e);return{name:e.name,version:e.version||"1.0.0"}})}triggerHook(t,...r){this.installed.forEach(e=>{if(e.hooks&&"function"==typeof e.hooks[t])try{e.hooks[t](...r)}catch(e){this.kernel.diagnostics.reportError(e)}})}}class v{constructor(e){this.kernel=e,this.routes=[],this.intent=null}}class w{constructor(e){this.kernel=e,this.errors=[],this.listeners=new Map,this.updateCounts=new Map,this.warnedStates=new Set}on(e,t){this.listeners.has(e)||this.listeners.set(e,[]),this.listeners.get(e).push(t)}emit(e,t){this.listeners.has(e)&&this.listeners.get(e).forEach(e=>e(t))}reportError(e){e={type:"error",message:e.message||String(e),timestamp:(new Date).toISOString(),stack:e.stack||""};this.errors.push(e),this.kernel.events.emit("error",e)}trackUpdate(e,t,r){var o=(this.updateCounts.get(e)||0)+1;this.updateCounts.set(e,o),100<o&&!this.warnedStates.has(e)&&(this.warnedStates.add(e),this.emit("performance",{type:"High Re-renders",message:`State variable updated ${o} times, potential infinite re-render loop detected!`,state:e,count:o}))}}function e(){let s="undefined"!=typeof document?document:a;function l(a,...e){if(o&&!d.includes(a)){let r=1/0,o="";d.forEach(e=>{var t=((r,o)=>{var e=r<o?r+","+o:o+","+r;if(y.has(e))return y.get(e);var a=[];for(let t=0;t<=r.length;t++){var n=[t];for(let e=1;e<=o.length;e++)n.push(0===t?e:Math.min(a[t-1][e]+1,n[e-1]+1,a[t-1][e-1]+(r[t-1]===o[e-1]?0:1)));a.push(n)}var t=a[r.length][o.length];return y.set(e,t),t})(a,e);t<r&&(r=t,o=e)});var t=`Unknown tag "${a}".`+(r<3?` Did you mean "${o}"?`:"");console.warn("PapyrWarning: "+t),l.diagnostics.errors.push({type:"warning",message:t,timestamp:(new Date).toISOString()}),"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent("papyr-warning",{detail:{tag:a,suggestion:r<3?o:""}}))}let i;if(a&&"script"===a.toLowerCase()){let r=(i=s.createElement(a)).setAttribute;i.setAttribute=function(e,t){e&&"src"===e.toLowerCase()&&l.security&&"function"==typeof l.security.shouldBlockScript&&l.security.shouldBlockScript(t)?console.warn("Papyr Security Kernel: Blocked tracking script from "+t):r.apply(this,arguments)},Object.defineProperty(i,"src",{set(e){l.security&&"function"==typeof l.security.shouldBlockScript&&l.security.shouldBlockScript(e)?console.warn("Papyr Security Kernel: Blocked tracking script from "+e):r.call(i,"src",e)},get(){return i.getAttribute("src")},configurable:!0})}else i=s.createElement(a);l.components.register(i);let n=r=>{if(null!=r)if("object"==typeof r&&"function"==typeof r.subscribe||"function"==typeof r)(e=>{var t=s.createTextNode("");i.appendChild(t);let n=[t],r=!1,o=e=>{if(!r){r=!0;try{let t=[],r=e=>{null!=e&&!1!==e&&(p(e)?t.push(e):Array.isArray(e)?e.forEach(r):"function"==typeof e?r(e()):t.push(s.createTextNode(String(e))))},o=(r(e),0===t.length&&t.push(s.createTextNode("")),n[0]),a=o.parentNode;a&&(t.forEach(e=>{a.insertBefore(e,o)}),n.forEach(e=>{e.parentNode===a&&("function"==typeof a.removeChild?a.removeChild(e):"function"==typeof e.remove&&e.remove())}),n=t)}finally{r=!1}}},a;e&&"function"==typeof e.subscribe?a=e.subscribe(o):"function"==typeof e&&(a=l.effect(()=>{o(e())})),a&&(i._cleanups||(i._cleanups=[]),i._cleanups.push(a))})(r);else if(p(r))i.appendChild(r);else if(Array.isArray(r))r.forEach(n);else{var e,r=String(r),o=r.includes(":")&&!r.startsWith("http://")&&!r.startsWith("https://");if(r.startsWith(".")||r.startsWith("#")){let e=r,t="";o&&(a=r.indexOf(":"),e=r.substring(0,a),t=r.substring(a+1));var a=e.match(/[.#][^.#]+/g);a&&a.forEach(e=>{e.startsWith("#")?i.id=e.slice(1).trim():e.startsWith(".")&&e.slice(1).trim().split(/\s+/).forEach(e=>{e&&i.classList.add(e)})}),o&&i.appendChild(s.createTextNode(t))}else o&&(a=r.indexOf(":"),o=r.substring(0,a),[e,...a]=r.split(":"),a=a.join(":"),d.includes(o.toLowerCase()))?((o=s.createElement(o)).textContent=a,i.appendChild(o)):i.appendChild(s.createTextNode(r))}};return a&&"button"===a.toLowerCase()&&i.classList.add("papyr-btn"),e.forEach(e=>{null===e||"object"!=typeof e||p(e)||Array.isArray(e)||"function"==typeof e.subscribe?n(e):(e.style&&Object.entries(e.style).forEach(([t,e])=>{let r=e=>{t.startsWith("--")?i.style.setProperty(t,String(e)):"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&(i.style[t]=e)},o;e&&"function"==typeof e.subscribe?o=e.subscribe(r):"function"==typeof e?o=l.effect(()=>{r(e())}):r(e),o&&(i._cleanups||(i._cleanups=[]),i._cleanups.push(o))}),e.data&&Object.assign(i.dataset,e.data),e.attrs&&Object.assign(i,e.attrs),Object.entries(e).forEach(([o,r])=>{if(!["style","data","attrs"].includes(o))if("onMounted"===o)i._onMounted=r;else if("onUnmounted"===o)i._onUnmounted=r;else if("onUpdated"===o){i._onUpdated=r;var e=new MutationObserver(()=>{try{i._onUpdated(i)}catch(e){l.diagnostics.reportError(e)}});e.observe(i,{attributes:!0,childList:!0,subtree:!1}),i._updateObserver=e}else if("on"===o&&"object"==typeof r&&null!==r)Object.entries(r).forEach(([e,t])=>{i.addEventListener(e,t)});else if(o.startsWith("on")){e=o.slice(2).toLowerCase();i.addEventListener(e,r)}else if(o.startsWith("--"))i.style.setProperty(o,String(r));else if("paper"===o||"papyr"===o){let e=e=>{var a;a=i,(e=e)&&(Array.isArray(e)?e:String(e).split(/\s+/)).forEach(e=>{e=e.trim();if(e)if(e.includes(":")){var t=e.split(":");if(2===t.length){var r=t[0],t=t[1],r={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"}[r],o=c[t]?c:"undefined"!=typeof paperUtilities?paperUtilities:{};if(r&&o[t]){let e=a._papyrUniqueClass;e||(e="papyr-u-"+Math.random().toString(36).substring(2,8),a.classList.add(e),a._papyrUniqueClass=e);o=Object.entries(o[t]).map(([e,t])=>e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+`: ${t};`).join(" "),t=`@media (min-width: ${r})`;u(t,`.${e} { ${o} }`)}}}else{r=c[e]?c:"undefined"!=typeof paperUtilities?paperUtilities:{};r[e]?Object.entries(r[e]).forEach(([e,t])=>{a.style[e]=t}):a.classList.add(e)}})},t;r&&"function"==typeof r.subscribe?t=r.subscribe(e):"function"==typeof r?t=l.effect(()=>{e(r())}):e(r),t&&(i._cleanups||(i._cleanups=[]),i._cleanups.push(t))}else{let e=e=>{var t,r;"class"===o||"className"===o?(r=e,t=Array.isArray(r)?r.filter(Boolean).join(" "):"object"==typeof r&&null!==r?Object.keys(r).filter(e=>r[e]).join(" "):String(r),i._prevReactiveClasses&&i._prevReactiveClasses.forEach(e=>{e&&i.classList.remove(e)}),i._prevReactiveClasses=[],t&&t.split(" ").forEach(e=>{e&&(i.classList.add(e),i._prevReactiveClasses.push(e))})):o in i&&"__proto__"!==o&&"constructor"!==o&&"prototype"!==o?"boolean"==typeof e?(i[o]=e)?i.setAttribute(o,""):i.removeAttribute(o):i[o]=e:null==e||!1===e?i.removeAttribute(o):i.setAttribute(o,String(e))},t;r&&"function"==typeof r.subscribe?t=r.subscribe(e):"function"==typeof r?t=l.effect(()=>{e(r())}):e(r),t&&(i._cleanups||(i._cleanups=[]),i._cleanups.push(t))}}))}),l.plugins.triggerHook("onRender",i),i}l.state=new g(l);let t=new m(l);Object.defineProperty(l,"components",{get(){return t},set(e){e&&"object"==typeof e?Object.assign(t,e):console.warn("Papyr: Attempted to set papyr.components to a non-object value, ignored.")},configurable:!0}),l.events=new h(l),l.plugins=new b(l),l.runtime=new v(l),l.diagnostics=new w(l),l.on=(e,t)=>l.events.on(e,t),l.off=(e,t)=>l.events.off(e,t),l.emit=(e,t)=>l.events.emit(e,t),l.exportContext=()=>({components:l.components.list(),state:l.state.dump(),routes:l.runtime.routes||[],errors:l.diagnostics.errors,plugins:l.plugins.list()}),l.use=e=>("function"==typeof e?e(l):e&&"object"==typeof e&&l.plugins.register(e),l),l.theme=e=>(e&&void 0!==s&&Object.entries(e).forEach(([e,t])=>{s.documentElement&&s.documentElement.style&&(s.documentElement.style.setProperty("--papyr-"+e,t),s.documentElement.style.setProperty("--"+e,t))}),l),l.plugin=e=>l.use(e),d.forEach(t=>{l[t]=(...e)=>l(t,...e)}),l.flex={row:(...e)=>l("div",".flex-row",...e),col:(...e)=>l("div",".flex-col",...e),center:(...e)=>l("div",".flex-center",...e),between:(...e)=>l("div",".flex-between",...e),around:(...e)=>l("div",".flex-around",...e),wrap:(...e)=>l("div",".flex-wrap",...e)},l.grid=(...e)=>l("div",".grid",...e),l.container=(...e)=>l("div",".container",...e),l.row=(...e)=>l("div",".row",...e),l.col=(...e)=>l("div",".col",...e);l.component=class{constructor(){if(void 0===this.render)throw new Error("PapyrComponent must implement a render() method")}},l.errorBoundary=(e,t)=>{try{return e()}catch(e){if(l.diagnostics.reportError(e),"function"==typeof t)try{return t(e)}catch(e){return l.div(".papyr-error-fallback","Component failed to render.")}return l.div(".papyr-error-fallback",{style:{padding:"12px",background:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",borderRadius:"8px",color:"#fca5a5",fontSize:"0.85rem"}},"⚠️ Component Rendering Error: "+e.message)}},l.validate=n=>e=>{var t,r,o,a=Object.create(null);for(t in n)"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&Object.prototype.hasOwnProperty.call(n,t)&&(r=n[t],o=e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,!r.required||null!=o&&""!==o||(a[t]="Required field"),r.type)&&typeof o!==r.type&&(a[t]="Must be of type "+r.type);return Object.keys(a).length?a:null},l.inspect=e=>{var t=s.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML},l.mount=(e,t)=>{e=s.querySelector(e);return e&&(e.innerHTML="",e.appendChild(t)),e},l.ready=e=>{"undefined"!=typeof document&&"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()},l.debug=e=>{(o=e)&&console.log("📄 Papyr Debug Mode Enabled.")},l.delay=t=>new Promise(e=>setTimeout(e,t)),l.copy=e=>navigator.clipboard.writeText(e),l.fragment=(...e)=>{let t=s.createDocumentFragment();return e.forEach(e=>{Array.isArray(e)?e.forEach(e=>{e instanceof Element?t.appendChild(e):t.appendChild(s.createTextNode(String(e)))}):e instanceof Element||e instanceof DocumentFragment?t.appendChild(e):null!=e&&t.appendChild(s.createTextNode(String(e)))}),t},l.html=e=>{var t=s.createElement("template");return t.innerHTML=e.trim(),t.content.cloneNode(!0)},l.fadeIn=(e,t=400)=>{e.style.opacity="0",e.style.transition=`opacity ${t}ms ease`,requestAnimationFrame(()=>{e.style.opacity="1"})},l.fadeOut=(e,t=400)=>{e.style.opacity="1",e.style.transition=`opacity ${t}ms ease`,requestAnimationFrame(()=>{e.style.opacity="0"}),setTimeout(()=>e.remove(),t)},l.animate=(e,t,r=400)=>{e.style.transition=`all ${r}ms cubic-bezier(0.4, 0, 0.2, 1)`,requestAnimationFrame(()=>{Object.assign(e.style,t)})},l.loadFramework=e=>{var t,r="papyr-fw-"+e;document.getElementById(r)||("tailwind"===e?((t=document.createElement("script")).id=r,t.src="https://cdn.tailwindcss.com",document.head.appendChild(t)):"bootstrap"===e&&((t=document.createElement("link")).id=r,t.rel="stylesheet",t.href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css",(e=s.getElementById("papyr-complete-styles")||s.querySelector('link[href*="styles.css"]')||s.querySelector("style"))&&e.parentNode?e.parentNode.insertBefore(t,e):s.head&&s.head.appendChild(t),s&&s.documentElement&&s.documentElement.setAttribute("data-bs-theme","dark"),s)&&s.body&&s.body.setAttribute("data-bs-theme","dark"))},l.init=(e={})=>{e.privacy&&(l.security&&"function"==typeof l.security.setTier?l.security.setTier(e.privacy):l._initialPrivacy=e.privacy),void 0!==e.debug&&l.debug(e.debug)};let e="undefined"!=typeof window?window.papyr:null;if(l.noConflict=()=>("undefined"!=typeof window&&(window.papyr=e),l),(l.el=l).ssr=e=>e?(e="function"==typeof e?e():e).innerHTML||String(e):"",l.ssr.render=e=>l.ssr(e),f.forEach(e=>{try{e(l)}catch(e){console.error("Error during core initialization",e)}}),"undefined"!=typeof window&&"undefined"!=typeof MutationObserver&&"undefined"!=typeof document){let e=new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{if(1===e.nodeType){let t=e=>{if(e._onMounted&&!e._isMounted){e._isMounted=!0;try{e._onMounted(e)}catch(e){l.diagnostics.reportError(e)}}Array.from(e.children||[]).forEach(t)};t(e)}}),e.removedNodes.forEach(e=>{if(1===e.nodeType)if("function"==typeof l._cleanupElement)l._cleanupElement(e);else{let t=e=>{if(e._cleanups&&(e._cleanups.forEach(e=>{if("function"==typeof e)try{e()}catch(e){l.diagnostics.reportError(e)}}),e._cleanups=[]),e._onUnmounted){e._isMounted=!1;try{e._onUnmounted(e)}catch(e){l.diagnostics.reportError(e)}}Array.from(e.children||[]).forEach(t)};t(e)}})})});var r=()=>{document.body&&e.observe(document.body,{childList:!0,subtree:!0})};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):r()}return l}"undefined"!=typeof module&&module.exports?module.exports=e:"undefined"!=typeof window&&(window.createPapyr=e);{let a=Object.create(null),n=["_ga","_gid","_fbp","_uid_tracking_id","tracking","analytics","pixel","adsense"],i=null,t=null,l=null;"undefined"!=typeof window&&window.localStorage&&("function"==typeof localStorage.setItem&&(i=localStorage.setItem.bind(localStorage)),"function"==typeof localStorage.getItem&&(t=localStorage.getItem.bind(localStorage)),"function"==typeof localStorage.removeItem)&&(l=localStorage.removeItem.bind(localStorage)),f.push(s=>{s.security={_isActive:!0,currentTier:"default",hasConsent:!1,_scriptsBlocked:!1,setTier(e){"high"===(this.currentTier=e)&&this.blockThirdPartyScripts()},setConsent(e){if(this.hasConsent=!!e,e)try{i&&Object.entries(a).forEach(([e,t])=>{i(e,t)}),a=Object.create(null)}catch(e){}else try{if(l){var r=[];for(let e=0;e<localStorage.length;e++){var o=localStorage.key(e);if(o){let t=o.toLowerCase();n.some(e=>t.includes(e))&&r.push(o)}}r.forEach(e=>l(e))}}catch(e){}},shouldBlockScript(t){var e;return"none"!==this.currentTier&&!(!t||"string"!=typeof t||(e=["analytics","pixel","doubleclick","google-analytics","adsense","ad-tracker","facebook.net","adnxs"].some(e=>t.toLowerCase().includes(e)),("high"!==this.currentTier||!e)&&("default"!==this.currentTier||this.hasConsent||!e)))},blockThirdPartyScripts(){if("undefined"!=typeof document&&!this._scriptsBlocked){this._scriptsBlocked=!0;let r=document.createElement;document.createElement=function(e,t){let o=r.call(document,e,t);if(e&&"script"===e.toLowerCase()){let r=o.setAttribute;o.setAttribute=function(e,t){e&&"src"===e.toLowerCase()&&s.security.shouldBlockScript(t)?console.warn("Papyr Security Kernel: Blocked tracking script from "+t):r.apply(this,arguments)},Object.defineProperty(o,"src",{set(e){s.security.shouldBlockScript(e)?console.warn("Papyr Security Kernel: Blocked tracking script from "+e):r.call(o,"src",e)},get(){return o.getAttribute("src")},configurable:!0})}return o}}},shouldSandboxStorage(t){return"none"!==this.currentTier&&("high"===this.currentTier||!this.hasConsent&&n.some(e=>t.toLowerCase().includes(e)))},sanitize(e){if(!this._isActive||"string"!=typeof e)return e;let o=e;if("undefined"!=typeof window&&"undefined"!=typeof DOMParser)try{var n=(new DOMParser).parseFromString(e,"text/html");let t=["div","span","p","h1","h2","h3","h4","h5","h6","button","a","img","ul","ol","li","table","thead","tbody","tr","td","th","form","label","input","textarea","select","option","pre","code","strong","em","small","hr","br","canvas","svg","path","rect","circle"],a=["class","style","id","href","src","alt","title","placeholder","type","name","value","checked","disabled","rows","cols","width","height","viewBox","d","role","aria-live","aria-modal","aria-labelledby","tabindex","aria-label"],r=o=>{var e;1===o.nodeType&&(e=o.tagName.toLowerCase(),t.includes(e)&&"script"!==e?(Array.from(o.attributes).forEach(e=>{var t=e.name.toLowerCase(),r=e.value.toLowerCase().trim();a.includes(t)&&!t.startsWith("on")&&!r.includes("javascript:")||o.removeAttribute(e.name)}),Array.from(o.childNodes).forEach(r)):o.parentNode.removeChild(o))};Array.from(n.body.childNodes).forEach(r),o=n.body.innerHTML}catch(e){}return o!==e&&"undefined"!=typeof DOMParser||(o=(o=(o=(o=(o=(o=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"")).replace(/\s+on\w+\s*=\s*"[^"]*"/gi,"")).replace(/\s+on\w+\s*=\s*'[^']*'/gi,"")).replace(/\s+on\w+\s*=\s*\w+/gi,"")).replace(/href\s*=\s*['"]\s*javascript:[^'"]*['"]/gi,'href="#"')).replace(/src\s*=\s*['"]\s*javascript:[^'"]*['"]/gi,'src=""')),e!==o&&s.warn&&s.warn("Papyr Security Interceptor blocked a potential XSS payload."),o},use(e){"disable"===e&&(this._isActive=!1,s.warn)&&s.warn("Papyr Security Kernel DISABLED. You are vulnerable to XSS.")},encrypt(e,t){if(!e)return e;var r="undefined"!=typeof window?unescape(encodeURIComponent(e)):Buffer.from(e,"utf8").toString("binary");let o="",a=0;for(let e=0;e<r.length;e++){var n=t.charCodeAt(e%t.length)+e+a&255,n=r.charCodeAt(e)^n;o+=String.fromCharCode(n),a=n}return"undefined"!=typeof window?window.btoa(o):Buffer.from(o,"binary").toString("base64")},decrypt(e,o){if(!e)return e;try{var a="undefined"!=typeof window?window.atob(e):Buffer.from(e,"base64").toString("binary");let t="",r=0;for(let e=0;e<a.length;e++){var n=o.charCodeAt(e%o.length)+e+r&255,i=a.charCodeAt(e)^n;t+=String.fromCharCode(i),r=a.charCodeAt(e)}return"undefined"!=typeof window?decodeURIComponent(escape(t)):Buffer.from(t,"binary").toString("utf8")}catch(e){return s.warn&&s.warn("Papyr Security: Decryption failed (invalid key or corrupted data)."),null}},async encryptAsync(r,o){if("undefined"==typeof window||!window.crypto||!window.crypto.subtle)return this.encrypt(r,o);try{var e=new TextEncoder,a=window.crypto.getRandomValues(new Uint8Array(16)),n=window.crypto.getRandomValues(new Uint8Array(12)),i=await window.crypto.subtle.importKey("raw",e.encode(o),"PBKDF2",!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:a,iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["encrypt"]),l=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,e.encode(r)),d=new Uint8Array(a.length+n.length+l.byteLength);d.set(a,0),d.set(n,a.length),d.set(new Uint8Array(l),a.length+n.length);let t="";for(let e=0;e<d.byteLength;e++)t+=String.fromCharCode(d[e]);return window.btoa(t)}catch(e){return console.error("Papyr Security: Async Encryption failed, falling back to sync.",e),this.encrypt(r,o)}},async decryptAsync(t,r){if("undefined"==typeof window||!window.crypto||!window.crypto.subtle)return this.decrypt(t,r);try{var o=window.atob(t),a=new Uint8Array(o.length);for(let e=0;e<o.length;e++)a[e]=o.charCodeAt(e);var e=a.slice(0,16),n=a.slice(16,28),i=a.slice(28),s=new TextEncoder,l=await window.crypto.subtle.importKey("raw",s.encode(r),"PBKDF2",!1,["deriveKey"]),d=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:e,iterations:1e5,hash:"SHA-256"},l,{name:"AES-GCM",length:256},!1,["decrypt"]),p=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:n},d,i);return(new TextDecoder).decode(p)}catch(e){return console.error("Papyr Security: Async Decryption failed, falling back to sync.",e),this.decrypt(t,r)}}},s.safeGet=(e,t)=>{if(e&&"object"==typeof e){if("__proto__"===t||"constructor"===t||"prototype"===t)throw new Error("Security Violation: Unsafe property access");return e[t]}}}),"undefined"!=typeof window&&window.localStorage&&(localStorage.setItem=function(e,t){window.papyr&&window.papyr.security&&window.papyr.security.shouldSandboxStorage(e)?e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(a[e]=t):i&&i(e,t)},localStorage.getItem=function(e){return window.papyr&&window.papyr.security&&window.papyr.security.shouldSandboxStorage(e)?e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&Object.prototype.hasOwnProperty.call(a,e)?a[e]:null:t?t(e):null},localStorage.removeItem=function(e){window.papyr&&window.papyr.security&&window.papyr.security.shouldSandboxStorage(e)?e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&Object.prototype.hasOwnProperty.call(a,e)&&delete a[e]:l&&l(e)})}f.push(p=>{let c=e=>!(!e||"object"!=typeof e)&&("undefined"!=typeof Element&&e instanceof Element||"undefined"!=typeof DocumentFragment&&e instanceof DocumentFragment||"string"==typeof e.tagName&&"function"==typeof e.appendChild||1===e.nodeType||11===e.nodeType),u=e=>{if(e){if(e._cleanups&&(e._cleanups.forEach(e=>{if("function"==typeof e)try{e()}catch(e){p.diagnostics.reportError(e)}}),e._cleanups=[]),e._onUnmounted){e._isMounted=!1;try{e._onUnmounted(e)}catch(e){p.diagnostics.reportError(e)}}if(e._updateObserver)try{e._updateObserver.disconnect()}catch(e){}Array.from(e.children||[]).forEach(u)}},i=(p._cleanupElement=u,(e,n)=>null===e||"object"!=typeof e||c(e)?e:new Proxy(e,{get(t,e,r){let o=Reflect.get(t,e,r);return Array.isArray(t)&&"function"==typeof o&&["push","pop","splice","shift","unshift","sort","reverse"].includes(e)?function(...e){e=o.apply(t,e);return n(),e}:null===o||"object"!=typeof o||c(o)?o:i(o,n)},set(e,t,r,o){var a=e[t],e=Reflect.set(e,t,r,o);return a!==r&&n(),e}})),s=(p.state=r=>{let o=new Set,e=()=>{p.diagnostics.trackUpdate(a,r,r),Array.from(o).forEach(e=>e(r)),p.plugins.triggerHook("onUpdate",a)},a={_subscribers:o,get value(){return l&&(o.add(l),"function"==typeof l._addDep)&&l._addDep(a),i(r,e)},set value(t){var e;(r!==t||"object"==typeof t&&null!==t)&&(e=r,r=t,p.diagnostics.trackUpdate(a,t,e),Array.from(o).forEach(e=>e(t)),p.plugins.triggerHook("onUpdate",a))},subscribe(e){return o.add(e),e(r),()=>o.delete(e)},dump(){return r}};return p.state.register(a),a},p.state.states=new Set,p.state.register=e=>p.state.states.add(e),p.state.list=()=>Array.from(p.state.states),p.state.dump=()=>{let t={},r=0;return p.state.states.forEach(e=>{t["state_"+r++]=e.value}),t},[]);p.computed=e=>{let t=new Set,r,o=!0,a=()=>{o=!0,Array.from(t).forEach(e=>e(n.value))},n=(a._deps=new Set,a._addDep=e=>{a._deps.add(e)},{_subscribers:t,get value(){if(o){a._deps.forEach(e=>{e._subscribers&&e._subscribers.delete(a)}),a._deps.clear(),s.push(a),l=a;try{r=e(),o=!1}catch(e){p.diagnostics.reportError(e)}finally{s.pop(),l=s[s.length-1]||null}}return l&&(t.add(l),"function"==typeof l._addDep)&&l._addDep(n),r},subscribe(e){return t.add(e),e(n.value),()=>{t.delete(e),0===t.size&&(a._deps.forEach(e=>{e._subscribers&&e._subscribers.delete(a)}),a._deps.clear(),o=!0)}}});return n},p.effect=e=>{let t=()=>{t._deps.forEach(e=>{e._subscribers&&e._subscribers.delete(t)}),t._deps.clear(),s.push(t),l=t;try{e()}catch(e){p.diagnostics.reportError(e)}finally{s.pop(),l=s[s.length-1]||null}};return t._deps=new Set,t._addDep=e=>{t._deps.add(e)},t(),()=>{t._deps.forEach(e=>{e._subscribers&&e._subscribers.delete(t)}),t._deps.clear()}},p.if=(e,t,r)=>{let o=p.div({style:{display:"contents"}}),a=null,n=void 0;var i,s=e=>{var e=!!e;e!==n&&(n=e,o.childNodes&&Array.from(o.childNodes).forEach(u),o.innerHTML="",(e=e?t:r)?(a="function"==typeof e?e():e,o.appendChild(a)):a=null)};let l;return e&&"function"==typeof e.subscribe?l=e.subscribe(s):"function"==typeof e?(i=p.computed(()=>!!e()),l=i.subscribe(s)):s(!!e),l&&(o._cleanups||(o._cleanups=[]),o._cleanups.push(l)),o},p.for=(e,l)=>{let r=p.div({style:{display:"contents"}}),d=new Map;var t,o=e=>{if(Array.isArray(e)){let n=new Set,i=[],s=new Map;e.forEach((e,t)=>{var r=e&&"object"==typeof e&&void 0!==e.id?e.id:e,o=(s.get(r)||0)+1,r=(s.set(r,o),1===o?r:"object"==typeof r?"dup::"+o:r+"::dup::"+o),o=(n.add(r),d.get(r));let a;o&&o.item===e?a=o.el:(o&&u(o.el),(a=l(e,t))&&11===a.nodeType&&"undefined"!=typeof document&&((t=document.createElement("span")).style.display="contents",t.appendChild(a),a=t),c(a)&&(d.set(r,{el:a,item:e}),o)&&o.el&&o.el.parentNode&&o.el.parentNode.replaceChild(a,o.el)),c(a)&&i.push(a)}),d.forEach((e,t)=>{n.has(t)||(u(e.el),e.el.parentNode===r&&("function"==typeof r.removeChild?r.removeChild(e.el):"function"==typeof e.el.remove&&e.el.remove()),d.delete(t))}),i.forEach((e,t)=>{t=r.children?r.children[t]:null;t!==e&&(t?r.insertBefore(e,t):r.appendChild(e))})}else r.innerHTML="",d.clear()};return e&&"function"==typeof e.subscribe?(t=e.subscribe(o),r._cleanups||(r._cleanups=[]),r._cleanups.push(t)):o(e),r},p.signal=p.state,p.watch=(e,a)=>{if(e&&"function"==typeof e.subscribe){let r=!0,o;return e.subscribe(e=>{var t=o;o=e,r?(r=!1,a(e,void 0)):a(e,t)})}if("function"==typeof e){e=p.computed(e);let r=!0,o;return e.subscribe(e=>{var t=o;o=e,r?(r=!1,a(e,void 0)):a(e,t)})}},p.bind=(a,n)=>{if(a){let t="checkbox"===a.type,e=n.subscribe(e=>{t?a.checked=!!e:a.value=null!=e?e:""}),r=e=>{t?n.value=e.target.checked:"number"===a.type||"range"===a.type?n.value=parseFloat(e.target.value)||0:n.value=e.target.value},o=t?"change":"input";a.addEventListener(o,r),a._cleanups||(a._cleanups=[]),a._cleanups.push(()=>{e(),a.removeEventListener(o,r)})}},p.model=t=>({value:()=>t.value,oninput:e=>{"checkbox"===e.target.type?t.value=e.target.checked:"number"===e.target.type||"range"===e.target.type?t.value=parseFloat(e.target.value)||0:t.value=e.target.value}}),p.plugin=e=>p.use(e)}),f.push(o=>{let r=[],n=o.state(null),i=o.state({}),a=(o.route=(e,t)=>{e=e.startsWith("#")?e.substring(1):e;r.push({path:e,regex:new RegExp("^"+e.replace(/:\w+/g,"([^/]+)")+"$"),keys:(e.match(/:\w+/g)||[]).map(e=>e.slice(1)),componentFn:t}),o.runtime.routes=r},o.navigate=e=>{"undefined"!=typeof window&&(window.location.hash=e.startsWith("#")?e:"#"+e)},"undefined"!=typeof window&&window.addEventListener("hashchange",()=>{var e,t=window.location.hash.slice(1)||"/";let a=!1;for(e of r){let o=t.match(e.regex);if(o){let r={};e.keys.forEach((e,t)=>{r[e]=o[t+1]}),i.value=r,n.value=e.componentFn,a=!0;break}}a||(n.value=()=>o.div("404 - Route Not Found"))}),o.useParams=()=>i,o.router=()=>{"undefined"!=typeof window&&0<r.length&&!n.value&&window.dispatchEvent(new Event("hashchange"));let t=o.if(n,()=>{var e=n.value;return e&&e.prototype&&"function"==typeof o.component&&e.prototype instanceof o.component?(new e).render():"function"==typeof e?e():o.div()},()=>o.div());return"undefined"!=typeof document&&setTimeout(()=>{var e=document.querySelector(".papyr-main-content");e&&!e.contains(t)&&(e.innerHTML="",e.appendChild(t))},0),t},[]),s=o.state(null),l=o.state({}),d=()=>{if("undefined"!=typeof window){var t,r=window.location.pathname||"/";let e=!1;for(t of a){let o=r.match(t.regex);if(o){let r={};t.keys.forEach((e,t)=>{r[e]=o[t+1]}),l.value=r,s.value=t.componentFn,e=!0;break}}e||(s.value=()=>o.div("404 - Page Not Found"))}};o.page=(e,t)=>{if(void 0===e)return o.pageRouter();a.push({path:e,regex:new RegExp("^"+e.replace(/:\w+/g,"([^/]+)")+"$"),keys:(e.match(/:\w+/g)||[]).map(e=>e.slice(1)),componentFn:t}),"undefined"!=typeof window&&0<a.length&&!s.value&&setTimeout(d,10)},o.page.navigate=e=>{"undefined"!=typeof window&&(window.history.pushState(null,"",e),d())},o.usePageParams=()=>l,o.pageRouter=()=>{"undefined"!=typeof window&&0<a.length&&!s.value&&d();let t=o.if(s,()=>{var e=s.value;return e&&e.prototype&&"function"==typeof o.component&&e.prototype instanceof o.component?(new e).render():"function"==typeof e?e():o.div()},()=>o.div());return"undefined"!=typeof document&&setTimeout(()=>{var e=document.querySelector(".papyr-main-content");e&&!e.contains(t)&&(e.innerHTML="",e.appendChild(t))},0),t},"undefined"!=typeof window&&(window.addEventListener("popstate",d),window.addEventListener("click",e=>{var t=e.target.closest("a");t&&t.href&&t.origin===window.location.origin&&!t.hash&&!t.getAttribute("download")&&"_blank"!==t.target&&(e.preventDefault(),o.page.navigate(t.pathname+t.search))}))}),f.push(a=>{let r=e=>e.reduce((e,t)=>e.concat(Array.isArray(t)?r(t):t),[]),n=e=>{e=e&&"function"==typeof e.subscribe?e.value:e;return Array.isArray(e)?e.reduce((e,t)=>e+Number(t||0),0):Number(e||0)};a.math={sum:(...e)=>a.computed(()=>r(e).reduce((e,t)=>e+n(t),0)),sub:(e,t)=>a.computed(()=>n(e)-n(t)),mul:(...t)=>a.computed(()=>{var e=r(t);return 0===e.length?0:e.reduce((e,t)=>{t=t&&"function"==typeof t.subscribe?t.value:t;return Array.isArray(t)?e*t.reduce((e,t)=>e*Number(null==t?1:t),1):e*(null==t?1:Number(t))},1)}),div:(t,r)=>a.computed(()=>{var e=n(r);return 0===e?0:n(t)/e}),avg:(...t)=>a.computed(()=>{var e=r(t);return 0===e.length?0:e.reduce((e,t)=>e+n(t),0)/e.length}),percent:(t,r)=>a.computed(()=>{var e=n(r);return 0===e?0:n(t)/e*100}),round:(r,o=0)=>a.computed(()=>{var e=n(r),t=n(o),t=Math.pow(10,t);return Math.round(e*t)/t})}}),f.push(d=>{let t=a=>new Promise((r,o)=>{if("undefined"==typeof window||!window.indexedDB)return o(new Error("IndexedDB not supported"));var e=window.indexedDB.open("papyr_database");e.onsuccess=e=>{var t,e=e.target.result;e.objectStoreNames.contains(a)?r(e):(t=e.version+1,e.close(),(e=window.indexedDB.open("papyr_database",t)).onupgradeneeded=e=>{e.target.result.createObjectStore(a,{keyPath:"id"})},e.onsuccess=e=>{r(e.target.result)},e.onerror=e=>o(e))},e.onerror=e=>o(e),e.onupgradeneeded=e=>{e=e.target.result;e.objectStoreNames.contains(a)||e.createObjectStore(a,{keyPath:"id"})}}),o=(d.db=(i,e="local")=>{let o={local:{get:()=>{try{var e=localStorage.getItem("papyr_db_"+i);return e?JSON.parse(e):[]}catch(e){return console.error("PapyrDB [local] get error:",e),[]}},insert:e=>{try{var t=o.local.get();t.push(e),localStorage.setItem("papyr_db_"+i,JSON.stringify(t))}catch(e){console.error("PapyrDB [local] insert error:",e)}},update:(t,r)=>{try{var e=o.local.get().map(e=>e.id===t?{...e,...r}:e);localStorage.setItem("papyr_db_"+i,JSON.stringify(e))}catch(e){console.error("PapyrDB [local] update error:",e)}},delete:t=>{try{var e=o.local.get().filter(e=>e.id!==t);localStorage.setItem("papyr_db_"+i,JSON.stringify(e))}catch(e){console.error("PapyrDB [local] delete error:",e)}},clear:()=>{try{localStorage.removeItem("papyr_db_"+i)}catch(e){console.error("PapyrDB [local] clear error:",e)}}},session:{get:()=>{try{var e=sessionStorage.getItem("papyr_db_"+i);return e?JSON.parse(e):[]}catch(e){return console.error("PapyrDB [session] get error:",e),[]}},insert:e=>{try{var t=o.session.get();t.push(e),sessionStorage.setItem("papyr_db_"+i,JSON.stringify(t))}catch(e){console.error("PapyrDB [session] insert error:",e)}},update:(t,r)=>{try{var e=o.session.get().map(e=>e.id===t?{...e,...r}:e);sessionStorage.setItem("papyr_db_"+i,JSON.stringify(e))}catch(e){console.error("PapyrDB [session] update error:",e)}},delete:t=>{try{var e=o.session.get().filter(e=>e.id!==t);sessionStorage.setItem("papyr_db_"+i,JSON.stringify(e))}catch(e){console.error("PapyrDB [session] delete error:",e)}},clear:()=>{try{sessionStorage.removeItem("papyr_db_"+i)}catch(e){console.error("PapyrDB [session] clear error:",e)}}},indexeddb:{getAsync:()=>new Promise(r=>{t(i).then(t=>{try{let e=t.transaction(i,"readonly").objectStore(i).getAll();e.onsuccess=()=>{t.close(),r(e.result||[])},e.onerror=()=>{t.close(),r([])}}catch(e){t.close(),r([])}}).catch(()=>r([]))}),insertAsync:o=>new Promise(r=>{t(i).then(t=>{try{var e=t.transaction(i,"readwrite").objectStore(i);e.put(o).onsuccess=()=>{t.close(),r()},e.put(o).onerror=()=>{t.close(),r()}}catch(e){console.error("PapyrDB [indexeddb] insert error:",e),t.close(),r()}}).catch(()=>r())}),updateAsync:(e,n)=>new Promise(a=>{t(i).then(o=>{try{let t=o.transaction(i,"readwrite").objectStore(i),r=t.get(e);r.onsuccess=()=>{var e=r.result;e?(e={...e,...n},t.put(e).onsuccess=()=>{o.close(),a()},t.put(e).onerror=()=>{o.close(),a()}):(o.close(),a())},r.onerror=()=>{o.close(),a()}}catch(e){console.error("PapyrDB [indexeddb] update error:",e),o.close(),a()}}).catch(()=>a())}),deleteAsync:o=>new Promise(r=>{t(i).then(t=>{try{var e=t.transaction(i,"readwrite").objectStore(i);e.delete(o).onsuccess=()=>{t.close(),r()},e.delete(o).onerror=()=>{t.close(),r()}}catch(e){console.error("PapyrDB [indexeddb] delete error:",e),t.close(),r()}}).catch(()=>r())}),clearAsync:()=>new Promise(r=>{t(i).then(t=>{try{var e=t.transaction(i,"readwrite").objectStore(i);e.clear().onsuccess=()=>{t.close(),r()},e.clear().onerror=()=>{t.close(),r()}}catch(e){console.error("PapyrDB [indexeddb] clear error:",e),t.close(),r()}}).catch(()=>r())})},sqlite:{getAsync:()=>new Promise(o=>{if("undefined"!=typeof window&&window.sqlitePlugin)try{window.sqlitePlugin.openDatabase({name:"papyr.db",location:"default"}).transaction(e=>{e.executeSql(`CREATE TABLE IF NOT EXISTS ${i} (id TEXT PRIMARY KEY, data TEXT)`),e.executeSql("SELECT data FROM "+i,[],(e,t)=>{var r=[];for(let e=0;e<t.rows.length;e++)try{r.push(JSON.parse(t.rows.item(e).data))}catch(e){}o(r)},()=>o([]))},()=>o([]))}catch(e){o([])}else if("undefined"!=typeof window&&window.SQL&&window.papyrSQLiteDB)try{var e=window.papyrSQLiteDB,r=(e.run(`CREATE TABLE IF NOT EXISTS ${i} (id TEXT PRIMARY KEY, data TEXT)`),e.exec("SELECT data FROM "+i));let t=[];r&&r[0]&&r[0].values&&r[0].values.forEach(e=>{try{t.push(JSON.parse(e[0]))}catch(e){}}),o(t)}catch(e){o([])}else o([])}),insertAsync:r=>new Promise(t=>{if("undefined"!=typeof window&&window.sqlitePlugin)try{window.sqlitePlugin.openDatabase({name:"papyr.db",location:"default"}).transaction(e=>{e.executeSql(`CREATE TABLE IF NOT EXISTS ${i} (id TEXT PRIMARY KEY, data TEXT)`),e.executeSql(`INSERT OR REPLACE INTO ${i} (id, data) VALUES (?, ?)`,[r.id,JSON.stringify(r)])},()=>t(),()=>t())}catch(e){t()}else if("undefined"!=typeof window&&window.SQL&&window.papyrSQLiteDB)try{var e=window.papyrSQLiteDB;e.run(`CREATE TABLE IF NOT EXISTS ${i} (id TEXT PRIMARY KEY, data TEXT)`),e.run(`INSERT OR REPLACE INTO ${i} (id, data) VALUES (?, ?)`,[r.id,JSON.stringify(r)]),t()}catch(e){t()}else t()}),updateAsync:(a,n)=>new Promise(o=>{if("undefined"!=typeof window&&window.sqlitePlugin)try{window.sqlitePlugin.openDatabase({name:"papyr.db",location:"default"}).transaction(e=>{e.executeSql(`SELECT data FROM ${i} WHERE id = ?`,[a],(e,t)=>{if(0<t.rows.length)try{var r={...JSON.parse(t.rows.item(0).data),...n};e.executeSql(`INSERT OR REPLACE INTO ${i} (id, data) VALUES (?, ?)`,[a,JSON.stringify(r)],()=>o())}catch(e){o()}else o()},()=>o())},()=>o())}catch(e){o()}else if("undefined"!=typeof window&&window.SQL&&window.papyrSQLiteDB)try{var e,t=window.papyrSQLiteDB,r=t.exec(`SELECT data FROM ${i} WHERE id = '${a}'`);r&&r[0]&&r[0].values&&r[0].values[0]&&(e={...JSON.parse(r[0].values[0][0]),...n},t.run(`INSERT OR REPLACE INTO ${i} (id, data) VALUES (?, ?)`,[a,JSON.stringify(e)])),o()}catch(e){o()}else o()}),deleteAsync:r=>new Promise(t=>{if("undefined"!=typeof window&&window.sqlitePlugin)try{window.sqlitePlugin.openDatabase({name:"papyr.db",location:"default"}).transaction(e=>{e.executeSql(`DELETE FROM ${i} WHERE id = ?`,[r])},()=>t(),()=>t())}catch(e){t()}else if("undefined"!=typeof window&&window.SQL&&window.papyrSQLiteDB)try{window.papyrSQLiteDB.run(`DELETE FROM ${i} WHERE id = ?`,[r]),t()}catch(e){t()}else t()}),clearAsync:()=>new Promise(t=>{if("undefined"!=typeof window&&window.sqlitePlugin)try{window.sqlitePlugin.openDatabase({name:"papyr.db",location:"default"}).transaction(e=>{e.executeSql("DELETE FROM "+i)},()=>t(),()=>t())}catch(e){t()}else if("undefined"!=typeof window&&window.SQL&&window.papyrSQLiteDB)try{window.papyrSQLiteDB.run("DELETE FROM "+i),t()}catch(e){t()}else t()})}},a=(Object.keys(d.db.drivers).forEach(t=>{try{o[t]=d.db.drivers[t](i)}catch(e){console.error(`Failed to initialize custom db driver ${t}:`,e)}}),"local"!==e&&"session"!==e&&o[e]),n=e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&Object.prototype.hasOwnProperty.call(o,e)?o[e]:o.local,s=d.state([]),r=[],l=(a?n.getAsync().then(t=>{s.value=t,r.forEach(e=>e(t))}):s.value=n.get(),()=>{r.forEach(e=>e(s.value))});return{state:s,list(){return s.value},async listAsync(){var e;return a?(e=await n.getAsync(),s.value=e):s.value},find(t){return s.value.find(e=>e.id===t)},async findAsync(t){var e;return a&&(e=await n.getAsync(),s.value=e),s.value.find(e=>e.id===t)},query(e={}){let t=[...s.value];if("function"==typeof e.filter?t=t.filter(e.filter):e.filter&&"object"==typeof e.filter&&(t=t.filter(r=>Object.entries(e.filter).every(([e,t])=>"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&!!Object.prototype.hasOwnProperty.call(r,e)&&r[e]===t))),e.sort){let{field:a,direction:n="asc"}=e.sort;t.sort((e,t)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return 0;let r=Object.prototype.hasOwnProperty.call(e,a)?e[a]:void 0,o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;return"string"==typeof r&&(r=r.toLowerCase()),"string"==typeof o&&(o=o.toLowerCase()),r<o?"asc"===n?-1:1:r>o?"asc"===n?1:-1:0})}var r=e.offset||0,o=void 0!==e.limit?e.limit:t.length;return t.slice(r,r+o)},async queryAsync(e={}){var t;return a&&(t=await n.getAsync(),s.value=t),this.query(e)},insert(e){e={id:Date.now().toString(36)+Math.random().toString(36).substr(2,5),createdAt:(new Date).toISOString(),...e};return s.value=[...s.value,e],a?n.insertAsync(e).catch(e=>console.error("PapyrDBError:",e)):n.insert(e),l(),e},async insertAsync(e){e={id:Date.now().toString(36)+Math.random().toString(36).substr(2,5),createdAt:(new Date).toISOString(),...e};return s.value=[...s.value,e],a?await n.insertAsync(e):n.insert(e),l(),e},update(t,r){s.value=s.value.map(e=>e.id===t?{...e,...r,updatedAt:(new Date).toISOString()}:e);var e=this.find(t);e&&(a?n.updateAsync(t,e).catch(e=>console.error("PapyrDBError:",e)):n.update(t,e)),l()},async updateAsync(t,r){s.value=s.value.map(e=>e.id===t?{...e,...r,updatedAt:(new Date).toISOString()}:e);var e=this.find(t);e&&(a?await n.updateAsync(t,e):n.update(t,e)),l()},delete(t){s.value=s.value.filter(e=>e.id!==t),a?n.deleteAsync(t).catch(e=>console.error("PapyrDBError:",e)):n.delete(t),l()},async deleteAsync(t){s.value=s.value.filter(e=>e.id!==t),a?await n.deleteAsync(t):n.delete(t),l()},clear(){s.value=[],a?n.clearAsync().catch(e=>console.error("PapyrDBError:",e)):n.clear(),l()},async clearAsync(){s.value=[],a?await n.clearAsync():n.clear(),l()},watch(t){return r.push(t),t(s.value),()=>r=r.filter(e=>e!==t)},async transaction(e){var r,t=JSON.stringify(s.value),o={_ops:[],insert(e){e={id:Date.now().toString(36)+Math.random().toString(36).substr(2,5),createdAt:(new Date).toISOString(),...e};return this._ops.push({type:"insert",record:e}),e},update(e,t){this._ops.push({type:"update",id:e,data:t})},delete(e){this._ops.push({type:"delete",id:e})}};try{await e(o);for(let t of o._ops)"insert"===t.type?(a?await n.insertAsync(t.record):n.insert(t.record),s.value=[...s.value,t.record]):"update"===t.type?(s.value=s.value.map(e=>e.id===t.id?{...e,...t.data,updatedAt:(new Date).toISOString()}:e),(r=s.value.find(e=>e.id===t.id))&&(a?await n.updateAsync(t.id,r):n.update(t.id,r))):"delete"===t.type&&(s.value=s.value.filter(e=>e.id!==t.id),a?await n.deleteAsync(t.id):n.delete(t.id));l()}catch(e){throw s.value=JSON.parse(t),l(),e}}}},d.db.drivers={},d.db.registerDriver=(e,t)=>{"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(d.db.drivers[e]=t)},(e,t)=>{if(void 0===t){var r=localStorage.getItem(e);if(null==r)return null;try{return JSON.parse(r)}catch(e){return r}}null===t?localStorage.removeItem(e):localStorage.setItem(e,"object"==typeof t?JSON.stringify(t):String(t))}),a=(o.set=(e,t)=>o(e,t),o.get=e=>o(e),o.remove=e=>localStorage.removeItem(e),o.clear=()=>localStorage.clear(),o.secureSet=(e,t,r)=>{if(!d.security)return console.error("PapyrError: Security module not loaded.");localStorage.setItem(e,d.security.encrypt(JSON.stringify(t),r))},o.secureGet=(e,t)=>{if(!d.security)return console.error("PapyrError: Security module not loaded.");e=localStorage.getItem(e);if(!e)return null;try{return JSON.parse(d.security.decrypt(e,t))}catch(e){return null}},o.secureSetAsync=async(e,t,r)=>{if(!d.security||"function"!=typeof d.security.encryptAsync)return o.secureSet(e,t,r);t=await d.security.encryptAsync(JSON.stringify(t),r);localStorage.setItem(e,t)},o.secureGetAsync=async(e,t)=>{if(!d.security||"function"!=typeof d.security.decryptAsync)return o.secureGet(e,t);e=localStorage.getItem(e);if(!e)return null;try{var r=await d.security.decryptAsync(e,t);return JSON.parse(r)}catch(e){return null}},d.storage=o,(e,t)=>{if(void 0===t){var r=sessionStorage.getItem(e);if(null==r)return null;try{return JSON.parse(r)}catch(e){return r}}null===t?sessionStorage.removeItem(e):sessionStorage.setItem(e,"object"==typeof t?JSON.stringify(t):String(t))});a.set=(e,t)=>a(e,t),a.get=e=>a(e),a.remove=e=>sessionStorage.removeItem(e),a.clear=()=>sessionStorage.clear(),a.secureSet=(e,t,r)=>{if(!d.security)return console.error("PapyrError: Security module not loaded.");sessionStorage.setItem(e,d.security.encrypt(JSON.stringify(t),r))},a.secureGet=(e,t)=>{if(!d.security)return console.error("PapyrError: Security module not loaded.");e=sessionStorage.getItem(e);if(!e)return null;try{return JSON.parse(d.security.decrypt(e,t))}catch(e){return null}},a.secureSetAsync=async(e,t,r)=>{if(!d.security||"function"!=typeof d.security.encryptAsync)return a.secureSet(e,t,r);t=await d.security.encryptAsync(JSON.stringify(t),r);sessionStorage.setItem(e,t)},a.secureGetAsync=async(e,t)=>{if(!d.security||"function"!=typeof d.security.decryptAsync)return a.secureGet(e,t);e=sessionStorage.getItem(e);if(!e)return null;try{var r=await d.security.decryptAsync(e,t);return JSON.parse(r)}catch(e){return null}},d.session=a,d.data={local:e=>d.db(e,"local"),session:e=>d.db(e,"session"),indexed:e=>d.db(e,"indexeddb"),remote:e=>d.db(e,"firebase")},d.drafts={save(e,t){d.storage.set("papyr_draft_"+e,{data:t,timestamp:Date.now()})},restore(e){e=d.storage.get("papyr_draft_"+e);return e?e.data:null},clear(e){d.storage.remove("papyr_draft_"+e)}},d.continuity={_intervals:new Map,enable(e={}){let{key:r="default",target:o=null,interval:t=5e3,onSave:a=null}=e;this._intervals.has(r)||((e=()=>{let e=null;var t;"function"==typeof o?e=o():o&&"object"==typeof o&&void 0!==o.value?e=o.value:o&&"string"==typeof o&&(t=document.querySelector(o))&&(e="checkbox"===t.type?t.checked:t.value),null!==e&&(d.drafts.save(r,e),"function"==typeof a)&&a(e)})(),e=setInterval(e,t),this._intervals.set(r,e))},disable(e="default"){var t=this._intervals.get(e);t&&(clearInterval(t),this._intervals.delete(e))},restore(e={}){var{key:e="default",target:t=null,onRestore:r=null}=e,e=d.drafts.restore(e);return null!==e?("function"==typeof r?r(e):t&&"object"==typeof t&&void 0!==t.value?t.value=e:t&&"string"==typeof t&&(r=document.querySelector(t))&&("checkbox"===r.type?r.checked=!!e:r.value=e),e):null}},d.offline={_queue:[],_isOnline:"undefined"==typeof navigator||navigator.onLine,_syncListeners:new Set,enable(e={}){var{onSync:e=null}=e,e=(e&&this._syncListeners.add(e),"undefined"!=typeof window&&(window.addEventListener("online",()=>{this._isOnline=!0,this.sync()}),window.addEventListener("offline",()=>{this._isOnline=!1})),d.storage.get("papyr_offline_queue"));Array.isArray(e)&&(this._queue=e),this._isOnline&&this.sync()},queueWrite(e,t,r){this._queue.push({id:Date.now().toString(36)+Math.random().toString(36).substr(2,5),action:e,collection:t,data:r,timestamp:Date.now()}),d.storage.set("papyr_offline_queue",this._queue),this._isOnline&&this.sync()},async sync(){if(this._isOnline&&0!==this._queue.length){var t,e=[...this._queue];this._queue=[],d.storage.remove("papyr_offline_queue");for(t of e)for(var r of this._syncListeners)try{await r(t)}catch(e){console.error("Offline sync error, pushing back to queue:",e),this._queue.push(t),d.storage.set("papyr_offline_queue",this._queue)}}}},d.retry=async(e,t={})=>{var{retries:r=3,delay:t=1e3,factor:o=2,onError:a=null}=t;let n=t;for(let t=0;t<r;t++)try{return await e()}catch(e){if(a&&a(e,t+1),t===r-1)throw e;await new Promise(e=>setTimeout(e,n)),n*=o}}}),f.push(r=>{r.crud=(e,t=[])=>{let a=r.state((()=>{try{return r.storage(e)||t}catch(e){return t}})()),o=()=>{try{r.storage(e,a.value)}catch(e){console.warn("PapyrStorageWarning: LocalStorage sync failed.",e)}};return{state:a,list(){return a.value},query(e={}){let t=[...a.value];if("function"==typeof e.filter?t=t.filter(e.filter):e.filter&&"object"==typeof e.filter&&(t=t.filter(r=>Object.entries(e.filter).every(([e,t])=>"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&!!Object.prototype.hasOwnProperty.call(r,e)&&r[e]===t))),e.sort){let{field:a,direction:n="asc"}=e.sort;t.sort((e,t)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return 0;let r=Object.prototype.hasOwnProperty.call(e,a)?e[a]:void 0,o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;return"string"==typeof r&&(r=r.toLowerCase()),"string"==typeof o&&(o=o.toLowerCase()),r<o?"asc"===n?-1:1:r>o?"asc"===n?1:-1:0})}var r=e.offset||0,o=void 0!==e.limit?e.limit:t.length;return t.slice(r,r+o)},create(e){e={id:Date.now().toString(36)+Math.random().toString(36).substr(2,5),createdAt:(new Date).toISOString(),...e};return a.value=[...a.value,e],o(),e},read(t){return a.value.find(e=>e.id===t)},findById(e){return this.read(e)},update(t,r){a.value=a.value.map(e=>e.id===t?{...e,...r,updatedAt:(new Date).toISOString()}:e),o()},delete(t){a.value=a.value.filter(e=>e.id!==t),o()},clear(){a.value=[],o()}}}}),f.push(r=>{class e{constructor(e={}){Object.assign(this,e)}save(){var e=this.constructor.name.toLowerCase()+"s";return this.id?r.db(e).update(this.id,this):(e=r.db(e).insert(this),this.id=e.id),this}delete(){var e=this.constructor.name.toLowerCase()+"s";this.id&&r.db(e).delete(this.id)}static create(e){return new this(e).save()}static find(e){var t=this.name.toLowerCase()+"s",t=r.db(t).find(e);return t?new this(t):null}static all(){var e=this.name.toLowerCase()+"s";return r.db(e).state.value.map(e=>new this(e))}static watch(t){var e=this.name.toLowerCase()+"s";return r.db(e).watch(e=>{t(e.map(e=>new this(e)))})}}function t(t){if(!new.target)return{value:()=>t.value,oninput:e=>{"checkbox"===e.target.type?t.value=e.target.checked:"number"===e.target.type||"range"===e.target.type?t.value=parseFloat(e.target.value)||0:t.value=e.target.value}};Object.assign(this,t||{})}Object.setPrototypeOf(t,e),t.prototype=Object.create(e.prototype),r.model=t.prototype.constructor=t}),f.push(n=>{n.auth={user:n.state(null),_config:{provider:"local"},_providers:{},use(e){return this._config.provider=e,this._providers[e]||this},registerProvider(e,t){"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(this._providers[e]=t)},async _hashPassword(t){var e;if("undefined"!=typeof window&&window.crypto&&window.crypto.subtle)return e=(new TextEncoder).encode(t),e=await window.crypto.subtle.digest("SHA-256",e),Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join("");let r=0;for(let e=0;e<t.length;e++){var o=t.charCodeAt(e);r=(r<<5)-r+o,r&=r}return"sha256_poly_"+Math.abs(r).toString(16)},init(e){var t,r;this._config={...this._config,...e},"local"===this._config.provider&&(e=n.storage.get("auth_token"))&&(r=n.storage.get("papyr_auth_sessions")||{},(r=e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&Object.prototype.hasOwnProperty.call(r,e)?r[e]:null)&&(t="object"==typeof r?r.username:r,!((r="object"==typeof r?r.expiresAt:null)&&Date.now()>r))&&(r=n.storage.get("papyr_auth_users")||{},r=t&&"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&Object.prototype.hasOwnProperty.call(r,t)?r[t]:null)?this.user.value={id:r.id,username:t,token:e}:this.logout())},async login(t){if("local"!==this._config.provider)return(r=this._providers[this._config.provider])&&"function"==typeof r.login?(r=await r.login(t),this.user.value=r):Promise.reject(new Error(`Auth provider "${this._config.provider}" is not registered or does not support login.`));if(!t.username||!t.password)return Promise.reject(new Error("Authentication failed: Username and password are required."));var r=n.storage.get("papyr_auth_lockouts")||{},o=t.username&&"__proto__"!==t.username&&"constructor"!==t.username&&"prototype"!==t.username&&Object.prototype.hasOwnProperty.call(r,t.username)?r[t.username]:null;if(o&&5<=o.failedCount&&Date.now()<o.lockedUntil)return e=Math.ceil((o.lockedUntil-Date.now())/6e4),Promise.reject(new Error(`Account locked: Too many failed login attempts. Try again in ${e} minutes.`));var e=n.storage.get("papyr_auth_users")||{},e=t.username&&"__proto__"!==t.username&&"constructor"!==t.username&&"prototype"!==t.username&&Object.prototype.hasOwnProperty.call(e,t.username)?e[t.username]:null;if(!e)return Promise.reject(new Error("Authentication failed: Username does not exist."));var a=await this._hashPassword(t.password);if(e.passwordHash!==a){a=(o?o.failedCount:0)+1;let e=null;return 5<=a&&(e=Date.now()+9e5),t.username&&"__proto__"!==t.username&&"constructor"!==t.username&&"prototype"!==t.username&&(r[t.username]={failedCount:a,lockedUntil:e}),n.storage.set("papyr_auth_lockouts",r),5<=a?Promise.reject(new Error("Account locked: Too many failed login attempts. Locked for 15 minutes.")):Promise.reject(new Error(`Authentication failed: Incorrect password. ${5-a} attempts remaining.`))}t.username&&"__proto__"!==t.username&&"constructor"!==t.username&&"prototype"!==t.username&&Object.prototype.hasOwnProperty.call(r,t.username)&&(delete r[t.username],n.storage.set("papyr_auth_lockouts",r));o="local_session_"+Math.random().toString(36).substr(2,9),a=n.storage.get("papyr_auth_sessions")||{},o&&"__proto__"!=o&&"constructor"!=o&&"prototype"!=o&&(a[o]={username:t.username,expiresAt:Date.now()+72e5}),n.storage.set("papyr_auth_sessions",a),n.storage.set("auth_token",o),r={id:e.id,username:t.username,token:o};return this.user.value=r},async register(e){var t,r,o;return"local"===this._config.provider?e.username&&e.password?e.password.length<8?Promise.reject(new Error("Registration failed: Password must be at least 8 characters long.")):(r=n.storage.get("papyr_auth_users")||{},Object.prototype.hasOwnProperty.call(r,e.username)?Promise.reject(new Error("Registration failed: Username already exists.")):(t=await this._hashPassword(e.password),e.username&&"__proto__"!==e.username&&"constructor"!==e.username&&"prototype"!==e.username&&(r[e.username]={id:Date.now(),username:e.username,passwordHash:t}),n.storage.set("papyr_auth_users",r),t="local_session_"+Math.random().toString(36).substr(2,9),o=n.storage.get("papyr_auth_sessions")||{},t&&"__proto__"!=t&&"constructor"!=t&&"prototype"!=t&&(o[t]={username:e.username,expiresAt:Date.now()+72e5}),n.storage.set("papyr_auth_sessions",o),n.storage.set("auth_token",t),o=e.username&&"__proto__"!==e.username&&"constructor"!==e.username&&"prototype"!==e.username&&Object.prototype.hasOwnProperty.call(r,e.username)?r[e.username].id:Date.now(),this.user.value={id:o,username:e.username,token:t})):Promise.reject(new Error("Registration failed: Username and password are required.")):(r=this._providers[this._config.provider])&&"function"==typeof r.register?(o=await r.register(e),this.user.value=o):Promise.reject(new Error(`Auth provider "${this._config.provider}" is not registered or does not support registration.`))},logout(){var e,t;return"local"===this._config.provider?((t=n.storage.get("auth_token"))&&(e=n.storage.get("papyr_auth_sessions")||{},t)&&"__proto__"!==t&&"constructor"!==t&&"prototype"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&(delete e[t],n.storage.set("papyr_auth_sessions",e)),n.storage.set("auth_token",null),this.user.value=null,Promise.resolve()):(t=this._providers[this._config.provider])&&"function"==typeof t.logout?Promise.resolve(t.logout()).then(()=>{this.user.value=null}):(this.user.value=null,Promise.resolve())}}}),f.push(e=>{e.payments={_gateways:{},_config:{provider:"stripe"},use(e){return this._config=this._config||{},this._config.provider=e,this._gateways[e]||this},register(e,t){"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(this._gateways[e]=t)},resolve(e){return this._gateways[e]},async checkout(e,t){var r=this.resolve(e);return r?"function"!=typeof r.checkout?Promise.reject(new Error(`Payment gateway "${e}" does not implement checkout().`)):r.checkout(t):Promise.reject(new Error(`Payment gateway "${e}" is not registered.`))}}}),f.push(a=>{a.api={async get(t,e={}){try{var r=await fetch(t,{method:"GET",headers:{Accept:"application/json",...e}});if(r.ok)return await r.json();throw new Error("HTTP error! Status: "+r.status)}catch(e){throw a.warn&&a.warn("papyr.api.get failed for "+t,e),e}},async post(t,e,r={}){try{var o=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...r},body:JSON.stringify(e)});if(o.ok)return await o.json();throw new Error("HTTP error! Status: "+o.status)}catch(e){throw a.warn&&a.warn("papyr.api.post failed for "+t,e),e}}},a.cloud={_providers:{},_config:{provider:"vercel"},register(e,t){"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(this._providers[e]=t)},use(e){return this._config=this._config||{},this._config.provider=e,this._providers[e]||this}}}),f.push(t=>{t.log=(...e)=>{console.log("%c Papyr Log ","background: #3b82f6; color: white; border-radius: 4px; font-weight: bold; padding: 2px 4px;",...e)},t.warn=(...e)=>{console.warn("%c Papyr Warning ","background: #f59e0b; color: white; border-radius: 4px; font-weight: bold; padding: 2px 4px;",...e),t.diagnostics.errors.push({type:"warning",message:e.map(String).join(" "),timestamp:(new Date).toISOString()})}}),"undefined"==typeof window||window.papyr||(window.papyr=e());var r,s=e();"undefined"!=typeof window?window.papyr=s:"undefined"!=typeof global&&(global.papyr=s);let x=s;if(void 0===x)console.warn("Papyr core not detected. Official plugins require papyr core to run.");else{let s={bolt:'<path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',lock:'<rect x="3" y="11" width="18" height="11" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none"/><path d="M7 11V7a5 5 0 0110 0v4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',unlock:'<rect x="3" y="11" width="18" height="11" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none"/><path d="M7 11V7a5 5 0 019.9-1" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',todo:'<path d="M9 11l3 3L22 4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/><rect x="3" y="4" width="18" height="18" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none"/>',home:'<path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/><path d="M9 22V12h6v10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',book:'<path d="M2 3h6a4 4 0 014 4v14a3 3 0 00-3-3H2zM22 3h-6a4 4 0 00-4 4v14a3 3 0 013-3h7z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',users:'<path d="M17 21v-2a4 4 0 00-3-3H5a4 4 0 00-4 4v2" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/><circle cx="9" cy="7" r="4" stroke="currentColor" stroke-width="2" fill="none"/><path d="M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',folder:'<path d="M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',search:'<circle cx="11" cy="11" r="8" stroke="currentColor" stroke-width="2" fill="none"/><path d="M21 21l-4.35-4.35" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',external:'<path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6M15 3h6v6M10 14L21 3" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',image:'<rect x="3" y="3" width="18" height="18" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none"/><circle cx="8.5" cy="8.5" r="1.5" fill="currentColor"/><path d="M21 15l-5-5L5 21" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',bell:'<path d="M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9M13.73 21a2 2 0 01-3.46 0" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',check:'<path d="M22 11.08V12a10 10 0 11-5.93-9.14M22 4L12 14.01l-3-3" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',info:'<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none"/><path d="M12 16v-4M12 8h.01" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',alert:'<path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/><path d="M12 9v4M12 17h.01" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',terminal:'<path d="M4 17l6-6-6-6M12 19h8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',copy:'<rect x="9" y="9" width="13" height="13" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',palette:'<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 14 3 16 4.5 17C5.5 17.6667 5.5 19 4 20C3 20.6667 3 22 5 22C6.5 22 8 21.5 9 20C9.66667 19.3333 10.3333 19 11 19C11.6667 19 12 20 12 22Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',code:'<path d="M16 18l6-6-6-6M8 6L2 12l6 6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',database:'<ellipse cx="12" cy="5" rx="9" ry="3" stroke="currentColor" stroke-width="2" fill="none"/><path d="M3 5v6c0 1.66 4 3 9 3s9-1.34 9-3V5M3 11v6c0 1.66 4 3 9 3s9-1.34 9-3v-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',github:'<path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 00-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0020 4.77 5.07 5.07 0 0019.91 1S18.73.65 16 2.48a13.38 13.38 0 00-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 005 4.77a5.44 5.44 0 00-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 009 18.13V22" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',settings:'<circle cx="12" cy="12" r="3" stroke="currentColor" stroke-width="2" fill="none"/><path d="M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 11-2.83 2.83l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 11-2.83-2.83l.06-.06a1.65 1.65 0 00.33-1.82 1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 112.83-2.83l.06.06a1.65 1.65 0 001.82.33H9a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 112.83 2.83l-.06.06a1.65 1.65 0 00-.33 1.82V9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',package:'<path d="M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/><path d="M3.27 6.96L12 12.01l8.73-5.05M12 22.08V12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',refresh:'<path d="M21.5 2v6h-6M21.34 15.57a10 10 0 11-.57-8.38l5.67-5.67" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',arrowRight:'<path d="M5 12h14M12 5l7 7-7 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',arrowLeft:'<path d="M19 12H5M12 19l-7-7 7-7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',star:'<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',plus:'<path d="M12 5v14M5 12h14" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',trash:'<path d="M3 6h18M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2M10 11v6M14 11v6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',edit:'<path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 113 3L12 15l-4 1 1-4 9.5-9.5z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',eye:'<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/><circle cx="12" cy="12" r="3" stroke="currentColor" stroke-width="2" fill="none"/>',calendar:'<rect x="3" y="4" width="18" height="18" rx="2" ry="2" stroke="currentColor" stroke-width="2" fill="none"/><path d="M16 2v4M8 2v4M3 10h18" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',save:'<path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 01-2-2h11l5 5v11a2 2 0 01-2 2z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/><path d="M17 21v-8H7v8M7 3v5h8" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',user:'<path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2" stroke="currentColor" stroke-width="2" fill="none"/><circle cx="12" cy="7" r="4" stroke="currentColor" stroke-width="2" fill="none"/>'},i=(x.icon=(e,t={})=>{var r=t.size||16,o=t.color||"currentColor",a=t.strokeWidth||2,n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width",String(r)),n.setAttribute("height",String(r)),n.setAttribute("viewBox","0 0 24 24"),n.style.display="inline-block",n.style.verticalAlign="middle",n.style.color=o,t.style&&Object.assign(n.style,t.style),t.class&&n.setAttribute("class",t.class);let i=e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&Object.prototype.hasOwnProperty.call(s,e)?s[e]:"";return 2!==a&&(i=i.replace(/stroke-width="2"/g,`stroke-width="${a}"`)),n.innerHTML=i,n},x.autoComplete=(r,o)=>{let a;var e,t=Array.isArray(r);(a=t?(e="string"==typeof o?o:"Search...",x.input("text",e,{style:{width:"100%"}})):"string"==typeof r?x.input("text",r,{style:{width:"100%"}}):r)&&"function"==typeof a.addEventListener||(e="string"==typeof o?o:"string"==typeof r?r:"Search...",(a=document.createElement("input")).type="text",a.placeholder=e,a.style.width="100%",a.className="input-text");let n=x.ul(".suggestions"),i=x.div(".autocomplete",a,n),s;return t?a.addEventListener("input",e=>{let t=e.target.value.toLowerCase().trim();n.innerHTML="",t&&r.filter(e=>e.toLowerCase().includes(t)).slice(0,5).forEach(t=>{var e=x.li(t,{on:{click:()=>{a.value=t,n.innerHTML="";var e=new CustomEvent("select",{detail:t}),e=(i.dispatchEvent(e),new CustomEvent("change",{detail:t}));i.dispatchEvent(e)}}});n.appendChild(e)})}):a.addEventListener("input",async e=>{clearTimeout(s);let t=e.target.value;t.length<2?n.innerHTML="":s=setTimeout(async()=>{try{var e=await(await fetch(""+o+t)).json();n.innerHTML="",(Array.isArray(e)?e:e.results||e.products||e.data||[]).slice(0,5).forEach(t=>{let r=t.title||t.name||t.username||t;var e=x.li(r,{on:{click:()=>{a.value=r,n.innerHTML="",x.onSuggestion&&x.onSuggestion(t);var e=new CustomEvent("select",{detail:t}),e=(i.dispatchEvent(e),new CustomEvent("change",{detail:r}));i.dispatchEvent(e)}}});n.appendChild(e)})}catch(e){console.error(e)}},300)}),document.addEventListener("click",e=>{i.contains(e.target)||(n.innerHTML="")}),i},x.form=(...t)=>{if(0<t.length&&Array.isArray(t[0])){let[e,r]=t,a=x("form",".papyr-form"),n=[];e.forEach(e=>{var t=x.div(".form-field"),r=x.label(e.label,{for:e.name});let o;"select"===e.type?(o=x.select({name:e.name,id:e.name}),e.options.forEach(e=>{o.appendChild(x.option(e,{value:e,textContent:e}))})):o="textarea"===e.type?x.textarea("",{name:e.name,id:e.name,rows:e.rows||3,placeholder:e.placeholder||""}):x.input("",{type:e.type||"text",name:e.name,id:e.name,placeholder:e.placeholder||""}),t.appendChild(r),t.appendChild(o),a.appendChild(t),n.push(o)});var o=x.button("Submit",{type:"submit",class:"btn-primary"});return a.appendChild(o),a.addEventListener("submit",e=>{e.preventDefault();let t=Object.create(null);n.forEach(e=>{e.name&&"__proto__"!==e.name&&"constructor"!==e.name&&"prototype"!==e.name&&(t[e.name]=e.value)}),r&&r(t)}),a}return x("form",...t)},x.card=(...e)=>{var t,r,o,a;return!(0<e.length&&"object"==typeof e[0])||e[0]instanceof Element||e[0]instanceof DocumentFragment||Array.isArray(e[0])||"function"==typeof e[0].subscribe?([a,o,r]=e,a=a?"string"==typeof a?x.h3(a,".card-title"):a:null,o=o?"string"==typeof o?x.div(o,".card-content"):o:null,t=[],a&&t.push(a),o&&t.push(o),r&&(a="string"==typeof r?x.div(r,".card-footer"):r,t.push(a)),x.div(".papyr-card",...t)):([o,...r]=e,a=(o={...o}).interactive,delete o.interactive,a&&(o.interactive="true"),x("div",".papyr-card",o,...r))},x.title=(...e)=>x("h1",".papyr-title",...e),x.muted=(...e)=>x("p",".papyr-muted",...e),x.modal=(e,t="Modal")=>{let r={},o=!1;null===e||"object"!=typeof e||e instanceof Element||e instanceof DocumentFragment?(r={content:e,title:"string"==typeof t?t:"Modal"},o=!0):r={...e};t=r.title||"Modal",e=r.content||"";let a=r.animation||"glass-pop",n=r.onClose,i=x.div({style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(2, 6, 23, 0.65)",backdropFilter:"blur(12px)",display:"flex",justifyContent:"center",alignItems:"center",zIndex:9998,opacity:0,transition:"opacity 0.3s ease"},on:{click:e=>{e.target===i&&u()}}});var s="papyr-modal-"+Math.random().toString(36).substring(2,9);let l=x.div(".papyr-card.papyr-modal-box",{id:s,role:"dialog","aria-modal":"true","aria-labelledby":s+"-title",tabIndex:-1,style:{padding:"24px",width:"90%",maxWidth:"450px",background:"rgba(15, 23, 42, 0.65)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"24px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.5)",transform:"glass-pop"===a?"scale(0.9) translateY(10px)":"translateY(50px)",transition:"transform 0.4s cubic-bezier(0.16, 1, 0.3, 1)"}},x.flex.between(x.h3(t,{id:s+"-title",style:{margin:0,color:"#fff",fontSize:"1.25rem",fontWeight:"600"}}),x.button("×",{class:"close-btn",ariaLabel:"Close Dialog",on:{click:()=>u()},style:{background:"transparent",border:"none",color:"#94a3b8",fontSize:"24px",cursor:"pointer",padding:"0 4px",lineLight:1}})),x.div({style:{marginTop:"16px",color:"#cbd5e1",fontSize:"0.95rem",lineHeight:"1.5"}},e)),d=(i.appendChild(l),"undefined"!=typeof document?document.activeElement:null),p=e=>{var t,r;"Tab"===e.key&&0!==(r=l.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).length&&(t=r[0],r=r[r.length-1],e.shiftKey?document.activeElement===t&&(r.focus(),e.preventDefault()):document.activeElement===r&&(t.focus(),e.preventDefault()))},c=e=>{"Escape"===e.key&&u()};t=()=>{"undefined"!=typeof document&&(document.body.appendChild(i),i.offsetHeight,i.style.opacity="1",l.style.transform="glass-pop"===a?"scale(1) translateY(0)":"translateY(0)",setTimeout(()=>{var e=l.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');(e||l).focus()},100),document.addEventListener("keydown",c),l.addEventListener("keydown",p))};let u=()=>{i.style.opacity="0",l.style.transform="glass-pop"===a?"scale(0.9) translateY(10px)":"translateY(50px)",document.removeEventListener("keydown",c),l.removeEventListener("keydown",p),setTimeout(()=>{i.remove(),d&&"function"==typeof d.focus&&d.focus(),n&&n()},300)};return o?(i.show=t,i.hide=u,i):(t(),{close:u})},x.modal.alert=(e,t="Alert")=>{"undefined"!=typeof window&&window.alert&&window.alert(t+`
2
+
3
+ `+e)},x.modal.confirm=(e,t)=>"undefined"!=typeof window&&window.confirm?(e=window.confirm(e),t&&t(e),e):(t&&t(!1),!1),null);x.toast=(o,a="info",n=3e3,e=!1)=>{if("undefined"!=typeof window){if("default"===a&&(a="info"),e&&"Notification"in window){let t=()=>{try{new Notification("Papyr Notification",{body:o,icon:"https://eldrex.landecs.org/logo/eldrex-papyr-js.png"})}catch(e){r()}};if("granted"===Notification.permission)return void t();if("denied"!==Notification.permission)return void Notification.requestPermission().then(e=>{("granted"===e?t:r)()})}r()}function r(){i||((i=document.createElement("div")).className="papyr-toast-container",i.style.cssText=`
4
+ position: fixed;
5
+ bottom: 24px;
6
+ right: 24px;
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: 12px;
10
+ z-index: 9999;
11
+ pointer-events: none;
12
+ `,document.body.appendChild(i));var e="error"===a?"rgba(239, 68, 68, 0.9)":"success"===a?"rgba(16, 185, 129, 0.9)":"warning"===a?"rgba(245, 158, 11, 0.9)":"rgba(59, 130, 246, 0.9)",t="error"===a?"✕ ":"success"===a?"✓ ":"warning"===a?"⚠ ":"ℹ ";let r=document.createElement("div");r.className="papyr-toast papyr-toast-"+a,r.setAttribute("role","alert"),r.setAttribute("aria-live","assertive"),r.style.cssText=`
13
+ background: ${e};
14
+ backdrop-filter: blur(8px);
15
+ border: 1px solid rgba(255,255,255,0.1);
16
+ color: #ffffff;
17
+ padding: 12px 24px;
18
+ border-radius: 16px;
19
+ box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
20
+ font-family: inherit;
21
+ font-size: 0.9rem;
22
+ font-weight: 500;
23
+ pointer-events: auto;
24
+ opacity: 0;
25
+ transform: translateY(20px) scale(0.95);
26
+ transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.1);
27
+ `,r.innerHTML=`<span style="font-weight: bold; margin-right: 6px;">${t}</span>`+o,i.appendChild(r),r.offsetHeight,r.style.opacity="1",r.style.transform="translateY(0) scale(1)",setTimeout(()=>{r.style.opacity="0",r.style.transform="translateY(-10px) scale(0.95)",setTimeout(()=>{r.remove(),i&&0===i.children.length&&(i.remove(),i=null)},350)},n)}},x.tabs=e=>{let o=x.div(".tab-headers"),a=x.div(".tab-contents"),n=x.div(".tabs",o,a);return e.forEach((t,r)=>{var e=x.button(t.title,{class:0===r?"tab-header tab-active":"tab-header",on:{click:()=>{n.querySelectorAll(".tab-header").forEach((e,t)=>{e.classList.toggle("tab-active",t===r)}),a.innerHTML="";var e="string"==typeof t.content?x.div(t.content):t.content;a.appendChild(e)}}});o.appendChild(e),0===r&&(e="string"==typeof t.content?x.div(t.content):t.content,a.appendChild(e))}),n},x.table=(...o)=>{if(0<o.length&&Array.isArray(o[0])&&"string"==typeof o[0][0]){let[e,t]=o;var n=x("table",".data-table"),i=x.thead();let r=x.tr(),a=(e.forEach(e=>{e=e.charAt(0).toUpperCase()+e.slice(1);r.appendChild(x.th(e))}),i.appendChild(r),n.appendChild(i),x.tbody());return t.forEach(r=>{let o=x.tr();e.forEach(e=>{var e=void 0!==r[e]?r[e]:"",t=x.td();e instanceof Element?t.appendChild(e):t.textContent=e,o.appendChild(t)}),a.appendChild(o)}),n.appendChild(a),n}return x("table",...o)},x.fetch=async(t,r={})=>{var e=x.div(".loading",x.div(".spinner"),x.span("Fetching data..."));let o=x.div(e);return setTimeout(async()=>{try{var e=await(await fetch(t,r)).json();o.innerHTML="",r.onSuccess?r.onSuccess(o,e):o.appendChild(x.pre(JSON.stringify(e,null,2)))}catch(e){o.innerHTML="",o.appendChild(x.div(".error","⚠️ Error: "+e.message))}},400),o},x.input=(e,t,r={})=>"object"==typeof e&&null!==e?x("input",e):("object"==typeof t&&null!==t&&(t=(r=t).placeholder||""),r=Object.assign({},r),e&&(r.type=r.type||e),t&&(r.placeholder=r.placeholder||t),e?x("input",".input-"+e,r):x("input",r)),x.simpleTable=e=>{var o=x("table",".papyr-table");if(e.headers){var r=x("thead");let t=x("tr");e.headers.forEach(e=>{t.appendChild(x("th",e))}),r.appendChild(t),o.appendChild(r)}if(e.rows){let r=x("tbody");e.rows.forEach(e=>{let t=x("tr");e.forEach(e=>{t.appendChild(x("td",String(e)))}),r.appendChild(t)}),o.appendChild(r)}return o},x.chart=(a,n,c={})=>{let i=x("canvas",{width:c.width||300,height:c.height||180,style:{display:"block",margin:"0 auto",maxWidth:"100%",borderRadius:"8px",background:"transparent"}});return requestAnimationFrame(()=>{let p=i.getContext("2d");if(p){var e,t=i.width;let d=i.height;if(p.clearRect(0,0,t,d),"bar"===a){var r=n.values||[];let i=n.labels||[],s=Math.max(...r,1);var o=r.length;let l=(t-16*(o+1))/o;r.forEach((e,t)=>{var r=e/s*(d-50),o=16+t*(16+l),a=d-30-r,n=(p.fillStyle="rgba(255,255,255,0.02)",p.beginPath(),p.roundRect?p.roundRect(o,10,l,d-40,6):p.rect(o,10,l,d-40),p.fill(),p.createLinearGradient(0,a,0,d-30));n.addColorStop(0,c.color||"#6366f1"),n.addColorStop(1,c.colorAlt||"#312e81"),p.fillStyle=n,p.beginPath(),p.roundRect?p.roundRect(o,a,l,r,[6,6,0,0]):p.rect(o,a,l,r),p.fill(),p.fillStyle="#f8fafc",p.font="bold 11px sans-serif",p.textAlign="center",p.fillText(e,o+l/2,a-8),p.fillStyle="#94a3b8",p.font="10px sans-serif",p.fillText(i[t]||"",o+l/2,d-10)})}else"ring"===a&&(o=n.value||0,r=t/2,e=d/2,t=Math.min(t,d)/2.6,p.beginPath(),p.arc(r,e,t,0,2*Math.PI),p.lineWidth=c.lineWidth||14,p.strokeStyle="rgba(255,255,255,0.06)",p.stroke(),p.beginPath(),p.arc(r,e,t,-Math.PI/2,-Math.PI/2+2*Math.PI*(o/100)),p.lineWidth=c.lineWidth||14,p.strokeStyle=c.color||"#10b981",p.lineCap="round",p.stroke(),p.fillStyle="#f8fafc",p.font="bold 24px sans-serif",p.textAlign="center",p.textBaseline="middle",p.fillText(o+"%",r,e-6),p.fillStyle="#94a3b8",p.font="10px sans-serif",p.fillText(n.label||"",r,16+e))}}),i},Object.assign(x.components,{navbar:(e,t)=>{var r=x.nav(".navbar");let o=x.div(".nav-links");t.forEach(e=>{o.appendChild(x.a(e.text,{href:e.href,class:"nav-link",onclick:e.onclick||null}))});t="string"==typeof e?x.div(e,".logo"):e;return r.appendChild(t),r.appendChild(o),r},hero:(e,t,r,o)=>x.section(".hero",x.h1(e,".hero-title"),x.p(t,".hero-subtitle"),x.button(r,{class:"hero-btn",on:{click:o}})),sidebar:e=>{let o=x.aside(".sidebar");return e.forEach(e=>{let t="string"==typeof e?e:e.text||"",r;r="object"==typeof e&&e.icon?x.div(".sidebar-item",x.icon(e.icon,{size:16,style:{marginRight:"8px"}}),x.span(t)):x.div(".sidebar-item",x.span(t)),e.active&&r.classList.add("active"),r.addEventListener("click",()=>{o.querySelectorAll(".sidebar-item").forEach(e=>e.classList.remove("active")),r.classList.add("active"),e.onclick?e.onclick(t):x.toast("Navigated to: "+t,"info")}),o.appendChild(r)}),o},footer:(e,t=[])=>{var r=x.footer(".footer");let o=x.div(".footer-links");return t.forEach(e=>{o.appendChild(x.a(e.text,{href:e.href}))}),r.appendChild(o),r.appendChild(x.p(e,".footer-text")),r},carousel:e=>{let o=0,t=x.img("",{src:e[0],class:"carousel-img"});var r=x.button("◀",{class:"carousel-btn prev-btn"}),a=x.button("▶",{class:"carousel-btn next-btn"});let n=x.div(".carousel-dots"),i=(e.forEach((e,t)=>{var r=x.span(".carousel-dot");0===t&&r.classList.add("active"),r.onclick=()=>{return e=t,o=e,void s();var e},n.appendChild(r)}),x.div(".carousel",r,t,a,n));function s(){t.style.opacity=0,setTimeout(()=>{t.src=e[o],t.style.opacity=1},150),i.querySelectorAll(".carousel-dot").forEach((e,t)=>{e.classList.toggle("active",t===o)})}return r.onclick=()=>{o=(o-1+e.length)%e.length,s()},a.onclick=()=>{o=(o+1)%e.length,s()},i}})}{x.center=(...e)=>x.div({style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"}},...e),x.left=(...e)=>x.div({style:{display:"flex",justifyContent:"flex-start",alignItems:"center",width:"100%"}},...e),x.right=(...e)=>x.div({style:{display:"flex",justifyContent:"flex-end",alignItems:"center",width:"100%"}},...e),x.justify=(...e)=>x.div({style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%"}},...e),x.glass=(...e)=>x.div({style:{background:"rgba(255, 255, 255, 0.05)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)",border:"1px solid rgba(255, 255, 255, 0.1)",boxShadow:"0 8px 32px 0 rgba(0, 0, 0, 0.3)",borderRadius:"16px"}},...e),x.template=e=>"glass-dashboard"===e?x.div({style:{display:"flex",minHeight:"100vh",background:"#0f172a",padding:"20px",gap:"20px"}},x.glass({style:{width:"250px",padding:"20px"}},x.h3("Sidebar")),x.div({style:{flexGrow:1,display:"flex",flexDirection:"column",gap:"20px"}},x.glass({style:{padding:"20px"}},x.h2("Dashboard Overview")),x.div({style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:"20px"}},x.glass({style:{padding:"40px",textAlign:"center"}},"Metric 1"),x.glass({style:{padding:"40px",textAlign:"center"}},"Metric 2")))):x.div(`Template ${e} not found.`);let l=e=>{if(!e)return null;var t,r,o,a,n,i={};e.absoluteBoundingBox&&(i.position="absolute",i.left=e.absoluteBoundingBox.x+"px",i.top=e.absoluteBoundingBox.y+"px",i.width=e.absoluteBoundingBox.width+"px",i.height=e.absoluteBoundingBox.height+"px"),e.fills&&0<e.fills.length&&"SOLID"===(o=e.fills[0]).type&&o.color&&(n=Math.round(255*o.color.r),t=Math.round(255*o.color.g),r=Math.round(255*o.color.b),o=void 0!==o.opacity?o.opacity:void 0!==o.color.a?o.color.a:1,i.background=`rgba(${n}, ${t}, ${r}, ${o})`),e.strokes&&0<e.strokes.length&&(n=e.strokes[0],t=e.strokeWeight||1,"SOLID"===n.type)&&n.color&&(r=Math.round(255*n.color.r),o=Math.round(255*n.color.g),a=Math.round(255*n.color.b),n=void 0!==n.opacity?n.opacity:void 0!==n.color.a?n.color.a:1,i.border=t+`px solid rgba(${r}, ${o}, ${a}, ${n})`),e.cornerRadius&&(i.borderRadius=e.cornerRadius+"px"),"HORIZONTAL"!==e.layoutMode&&"VERTICAL"!==e.layoutMode||(i.display="flex",i.flexDirection="HORIZONTAL"===e.layoutMode?"row":"column",e.itemSpacing&&(i.gap=e.itemSpacing+"px"),e.paddingTop&&(i.paddingTop=e.paddingTop+"px"),e.paddingBottom&&(i.paddingBottom=e.paddingBottom+"px"),e.paddingLeft&&(i.paddingLeft=e.paddingLeft+"px"),e.paddingRight&&(i.paddingRight=e.paddingRight+"px"));let s=[];return e.children&&Array.isArray(e.children)&&(s=e.children.map(l).filter(Boolean)),"TEXT"===e.type?(e.style&&(e.style.fontSize&&(i.fontSize=e.style.fontSize+"px"),e.style.fontWeight&&(i.fontWeight=String(e.style.fontWeight)),e.style.fontFamily&&(i.fontFamily=e.style.fontFamily),e.style.textAlignHorizontal)&&(i.textAlign=e.style.textAlignHorizontal.toLowerCase()),x.span(e.characters||"",{style:i})):x.div({style:i},...s)};x.import={figma:e=>{if(!e)return null;let t=e.document||e;return(t=t.children&&0<t.children.length&&"DOCUMENT"===t.type?t.children[0]:t).children&&0<t.children.length&&"CANVAS"===t.type&&(t=t.children[0]),l(t)}}}x.glass=(...e)=>x.div({class:"papyr-glass-panel",style:{background:"rgba(255, 255, 255, 0.04)",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)",border:"1px solid rgba(255, 255, 255, 0.08)",boxShadow:"0 8px 32px 0 rgba(0, 0, 0, 0.35)",borderRadius:"16px",padding:"20px",color:"#f8fafc"}},...e),x.autoFlex=(n,e={})=>{if(n&&"undefined"!=typeof window){let t=e.breakpoint||768,r=e.rowClass||"flex-row",o=e.colClass||"flex-col",a=e=>{e<t?(n.classList.remove(r),n.classList.add(o),n.style.flexDirection="column"):(n.classList.remove(o),n.classList.add(r),n.style.flexDirection="row")};if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver(e=>{for(var t of e)a(t.contentRect.width||t.target.clientWidth)});e.observe(n),n._cleanups||(n._cleanups=[]),n._cleanups.push(()=>e.disconnect())}else{let e=()=>a(window.innerWidth);window.addEventListener("resize",e),e(),n._cleanups||(n._cleanups=[]),n._cleanups.push(()=>window.removeEventListener("resize",e))}}return n},x.layout={flex(e={},...t){e=Object.assign({direction:"var(--papyr-flex-dir, row)",wrap:"var(--papyr-flex-wrap, wrap)",justify:"var(--papyr-flex-justify, flex-start)",align:"var(--papyr-flex-align, stretch)",gap:"var(--papyr-flex-gap, 16px)"},e);return x.div({class:"papyr-layout-flex",style:{display:"flex",flexDirection:e.direction,flexWrap:e.wrap,justifyContent:e.justify,alignItems:e.align,gap:e.gap,width:"100%"}},...t)},grid(e={},...t){e=Object.assign({cols:"var(--papyr-grid-cols, repeat(auto-fit, minmax(250px, 1fr)))",rows:"var(--papyr-grid-rows, auto)",gap:"var(--papyr-grid-gap, 20px)"},e);return x.div({class:"papyr-layout-grid",style:{display:"grid",gridTemplateColumns:e.cols,gridTemplateRows:e.rows,gap:e.gap,width:"100%"}},...t)},row(...e){return this.flex({direction:"row"},...e)},col(...e){return this.flex({direction:"column"},...e)},foldable(e={},...t){var r="undefined"!=typeof window&&(window.matchMedia("(spanning: single-fold-vertical)").matches||window.matchMedia("(spanning: single-fold-horizontal)").matches||window.innerWidth<900),e=Object.assign({gap:"24px"},e);return x.div({class:"papyr-foldable-layout",style:{display:"grid",gridTemplateColumns:r?"1fr":"1fr 1fr",gap:e.gap,width:"100%"}},...t)},mobile(e={},...t){var{header:e=null,nav:r=null}=e;return x.div({class:"papyr-layout-mobile",style:{display:"flex",flexDirection:"column",minHeight:"100vh",width:"100%",background:"#070913"}},e?x("header",{style:{padding:"16px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(16,22,42,0.8)"}},e):null,x("main",{style:{flexGrow:1,padding:"16px",overflowY:"auto"}},...t),r?x("nav",{style:{padding:"12px",borderTop:"1px solid rgba(255,255,255,0.08)",background:"rgba(16,22,42,0.9)",display:"flex",justifyContent:"space-around"}},r):null)},tablet(e={},...t){var{sidebar:e=null}=e;return x.div({class:"papyr-layout-tablet",style:{display:"flex",minHeight:"100vh",width:"100%",background:"#070913"}},e?x("aside",{style:{width:"80px",borderRight:"1px solid rgba(255,255,255,0.08)",background:"rgba(11,16,36,0.95)",display:"flex",flexDirection:"column",alignItems:"center",padding:"20px 0",gap:"20px"}},e):null,x("main",{style:{flexGrow:1,padding:"24px",overflowY:"auto"}},...t))},desktop(e={},...t){var{sidebar:e=null,inspector:r=null,sidebarWidth:o="250px",inspectorWidth:a="300px"}=e;return x.div({class:"papyr-layout-desktop",style:{display:"flex",minHeight:"100vh",width:"100%",background:"#070913"}},e?x("aside",{style:{width:o,borderRight:"1px solid rgba(255,255,255,0.08)",background:"rgba(11,16,36,0.95)",overflowY:"auto"}},e):null,x("main",{style:{flexGrow:1,padding:"24px",overflowY:"auto"}},...t),r?x("aside",{style:{width:a,borderLeft:"1px solid rgba(255,255,255,0.08)",background:"rgba(11,16,36,0.95)",overflowY:"auto"}},r):null)},dashboard(e={}){let{sidebar:t=null,header:r=null,main:o=null,footer:a=null,sidebarWidth:n="250px",headerHeight:i="64px"}=e,s=x.state(!0);var l,e=x.div({class:"papyr-app-shell",style:{display:"grid",gridTemplateColumns:t?n+" 1fr":"1fr",gridTemplateRows:r?i+" 1fr auto":"1fr auto",minHeight:"100vh",width:"100%",background:"#070913"}});return"undefined"!=typeof window&&(window.addEventListener("resize",l=()=>{window.innerWidth<768?s.value=!1:s.value=!0}),setTimeout(l,10)),r&&(l=x.button(".menu-toggle",{style:{background:"transparent",border:"none",color:"white",fontSize:"1.5rem",cursor:"pointer",padding:"10px",display:t?"inline-block":"none"},onclick:()=>{s.value=!s.value}},"☰"),e.appendChild(x("header",{class:"papyr-shell-header",style:{gridColumn:"1 / -1",background:"rgba(16, 22, 42, 0.8)",backdropFilter:"blur(12px)",borderBottom:"1px solid rgba(255,255,255,0.08)",display:"flex",alignItems:"center",padding:"0 20px",gap:"15px",zIndex:10}},l,r))),t&&(l=x("aside",{class:"papyr-shell-sidebar",style:()=>({gridRow:r?"2 / -1":"1 / -1",background:"rgba(11, 16, 36, 0.95)",borderRight:"1px solid rgba(255,255,255,0.08)",overflowY:"auto",width:s.value?n:"0px",minWidth:s.value?n:"0px",opacity:s.value?1:0,pointerEvents:s.value?"auto":"none",transition:"width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s"})},t),e.appendChild(l)),e.appendChild(x("main",{class:"papyr-main-content",style:{padding:"24px",overflowY:"auto",position:"relative",zIndex:1}},o||x.div("Main Content Area"))),a&&e.appendChild(x("footer",{class:"papyr-shell-footer",style:{gridColumn:t?"2 / -1":"1",background:"rgba(16, 22, 42, 0.8)",borderTop:"1px solid rgba(255,255,255,0.08)",padding:"12px 20px"}},a)),e},hero(e={}){var{title:e="Cinematic Experience",subtitle:t="Crafted beautifully with high performance reactivity",actions:r=[],theme:o="primary",glass:a=!0,padding:n="80px 40px"}=e;let i="teal"===o?"#14b8a6":"#6366f1",s="teal"===o?"#0d9488":"#4f46e5";o=x.flex.col({align:"center",style:{textAlign:"center",maxWidth:"800px",gap:"20px",zIndex:2,position:"relative"}},x.h1(e,{style:{fontSize:"var(--papyr-hero-title-size, 3.5rem)",fontWeight:"800",color:"white",margin:0,lineHeight:"1.1",letterSpacing:"-0.025em",background:`linear-gradient(135deg, #ffffff 30%, ${i} 100%)`,webkitBackgroundClip:"text",webkitTextFillColor:"transparent",textFillColor:"transparent"}}),x.p(t,{style:{fontSize:"1.25rem",color:"#94a3b8",margin:0,lineHeight:"1.6",maxWidth:"600px"}}));if(r&&0<r.length){let t=x.flex.row({justify:"center",gap:"12px",style:{marginTop:"10px"}});r.forEach(e=>{e instanceof Element?t.appendChild(e):"object"==typeof e&&(e=x.button(e.text||"Action",Object.assign({style:Object.assign({background:e.primary?`linear-gradient(135deg, ${i} 0%, ${s} 100%)`:"rgba(255,255,255,0.06)",border:e.primary?"none":"1px solid rgba(255,255,255,0.1)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"0.95rem",fontWeight:"bold",cursor:"pointer",transition:"all 0.25s",boxShadow:e.primary?`0 4px 15px ${i}40`:"none"},e.style||{})},e.attrs||{})),t.appendChild(e))}),o.appendChild(t)}e={display:"flex",justifyContent:"center",alignItems:"center",padding:n,width:"100%",position:"relative",overflow:"hidden",borderRadius:"16px"};return a?x.div({class:"papyr-hero-glass",style:Object.assign(e,{background:"rgba(10, 15, 30, 0.4)",backdropFilter:"blur(20px)",webkitBackdropFilter:"blur(20px)",border:"1px solid rgba(255,255,255,0.05)",boxShadow:"0 10px 40px -10px rgba(0,0,0,0.5)"})},o):x.div({style:e},o)}},x.toast=x.toast,x.modal=x.modal,x.sheet=(e={})=>{var{content:e=""}=e;let t=x.div({style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(0,0,0,0.5)",zIndex:9998,opacity:0,transition:"opacity 0.3s"},onclick:e=>{e.target===t&&o()}}),r=x.div({style:{position:"absolute",bottom:0,left:0,width:"100%",background:"#1e293b",borderTopLeftRadius:"24px",borderTopRightRadius:"24px",padding:"24px",transform:"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1)"}},x.div({style:{width:"40px",height:"4px",background:"rgba(255,255,255,0.2)",borderRadius:"2px",margin:"0 auto 20px auto"}}),e),o=(t.appendChild(r),document.body.appendChild(t),requestAnimationFrame(()=>{t.style.opacity="1",r.style.transform="translateY(0)"}),()=>{t.style.opacity="0",r.style.transform="translateY(100%)",setTimeout(()=>t.remove(),300)})},x.drawer=(e={})=>{let{content:t="",position:r="left"}=e,o=x.div({style:{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",background:"rgba(0,0,0,0.5)",zIndex:9998,opacity:0,transition:"opacity 0.3s"},onclick:e=>{e.target===o&&n()}}),a=x.div({style:{position:"absolute",top:0,[r]:0,width:"300px",height:"100%",background:"#0f172a",borderRight:"1px solid rgba(255,255,255,0.08)",padding:"24px",transform:"left"===r?"translateX(-100%)":"translateX(100%)",transition:"transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1)"}},t),n=(o.appendChild(a),document.body.appendChild(o),requestAnimationFrame(()=>{o.style.opacity="1",a.style.transform="translateX(0)"}),()=>{o.style.opacity="0",a.style.transform="left"===r?"translateX(-100%)":"translateX(100%)",setTimeout(()=>o.remove(),300)});return{close:n}},x.banner=(e={})=>{var{message:e="",type:t="info",actions:r=[]}=e,o="error"===t?"#7f1d1d":"success"===t?"#064e3b":"#1e3a8a";let a=x.div({class:"papyr-banner papyr-banner-"+t,style:{position:"sticky",top:0,left:0,width:"100%",background:o,color:"#f8fafc",padding:"12px 24px",display:"flex",justifyContent:"space-between",alignItems:"center",boxShadow:"0 4px 6px -1px rgba(0,0,0,0.1)",zIndex:999}},x.span(e,{style:{fontWeight:"500"}}),x.flex.row({gap:"12px"},...r.map(e=>x.button(e.text,{style:{padding:"6px 12px",fontSize:"13px",borderRadius:"6px",background:"rgba(255,255,255,0.1)",border:"1px solid rgba(255,255,255,0.2)",color:"white"},onclick:()=>{e.action(),a.remove()}})),x.button("×",{style:{background:"transparent",border:"none",color:"white",cursor:"pointer",fontSize:"20px"},onclick:()=>a.remove()})));document.body.prepend(a)},x.snackbar=(e={})=>{let{message:t="",actionText:r="",onAction:o=null,duration:a=4e3}=e,n=x.div({style:{position:"fixed",bottom:"24px",left:"24px",background:"#1e293b",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",padding:"12px 20px",color:"white",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.3)",zIndex:9999,display:"flex",alignItems:"center",gap:"16px",opacity:0,transform:"translateY(20px)",transition:"all 0.3s"}},x.span(t),r?x.button(r,{style:{background:"transparent",border:"none",color:"#6366f1",fontWeight:"bold",cursor:"pointer"},onclick:()=>{o&&o(),n.remove()}}):null);document.body.appendChild(n),requestAnimationFrame(()=>{n.style.opacity="1",n.style.transform="translateY(0)"}),setTimeout(()=>{n.style.opacity="0",n.style.transform="translateY(20px)",setTimeout(()=>n.remove(),300)},a)},x.tooltip=(r,o)=>{if(r){let t=null;r.addEventListener("mouseenter",()=>{var e=r.getBoundingClientRect();t=x.div({style:{position:"fixed",top:e.top-36+"px",left:e.left+e.width/2+"px",transform:"translateX(-50%)",background:"#0f172a",border:"1px solid rgba(255,255,255,0.1)",padding:"6px 12px",color:"white",fontSize:"12px",borderRadius:"6px",boxShadow:"0 4px 6px rgba(0,0,0,0.3)",zIndex:99999,pointerEvents:"none"}},o),document.body.appendChild(t)}),r.addEventListener("mouseleave",()=>{t&&(t.remove(),t=null)})}},x.accordion=e=>{let o=x.div(".accordion",{style:{display:"flex",flexDirection:"column",gap:"8px"}});return e.forEach(e=>{let t=x.state(!1);var r="string"==typeof e.content?x.div(e.content):e.content,r=x.div({style:()=>({display:t.value?"block":"none",padding:"16px",borderTop:"1px solid rgba(255,255,255,0.08)",color:"#94a3b8"})},r),e=x.button({style:{width:"100%",textAlign:"left",background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.08)",padding:"12px 16px",color:"white",display:"flex",justifyContent:"space-between",borderRadius:"8px"},onclick:()=>t.value=!t.value},x.span(e.title,{style:{fontWeight:"600"}}),x.span(()=>t.value?"▲":"▼"));o.appendChild(x.div(".accordion-item",e,r))}),o},x.checkbox=(e,t)=>{var r=x.input("checkbox",{checked:()=>t.value,onchange:e=>t.value=e.target.checked,style:{width:"auto",marginRight:"8px"}});return x.label({style:{display:"inline-flex",alignItems:"center",cursor:"pointer",color:"white"}},r,e)},x.radio=(e,t,r,o)=>{e=x.input("radio",{name:e,checked:()=>o.value===r,onchange:()=>o.value=r,style:{width:"auto",marginRight:"8px"}});return x.label({style:{display:"inline-flex",alignItems:"center",cursor:"pointer",color:"white"}},e,t)},x.navigationRail=e=>{let t=x.div(".navigation-rail",{style:{width:"72px",height:"100%",background:"#0a0f1d",borderRight:"1px solid rgba(255,255,255,0.08)",display:"flex",flexDirection:"column",alignItems:"center",padding:"24px 0",gap:"20px"}});return e.forEach(e=>{e=x.button({style:{background:"transparent",border:"none",cursor:"pointer",color:"#94a3b8",display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",padding:"8px"},onclick:e.onclick},x.icon(e.icon,{size:20}),x.span(e.label,{style:{fontSize:"10px",fontWeight:"500"}}));t.appendChild(e)}),t},x.progress=(e,t=100)=>{let r=e&&"function"==typeof e.subscribe?e:x.state(e),o=x.computed(()=>Math.min(100,Math.max(0,r.value/t*100))+"%");return x.div(".progress-track",{style:{width:"100%",height:"8px",background:"rgba(255,255,255,0.05)",borderRadius:"4px",overflow:"hidden",border:"1px solid rgba(255,255,255,0.08)"}},x.div(".progress-fill",{style:()=>({width:o.value,height:"100%",background:"linear-gradient(90deg, #6366f1, #10b981)",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)"})}))},x.stepper=(e,s)=>{let l=x.div(".stepper",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:"24px"}});return e.forEach((e,t)=>{let r=x.computed(()=>s.value>t+1),o=x.computed(()=>s.value===t+1),a=x.computed(()=>r.value?"#10b981":o.value?"#6366f1":"rgba(255,255,255,0.05)"),n=x.computed(()=>r.value||o.value?"none":"1px solid rgba(255,255,255,0.1)");var i=x.div(".step-circle",{style:()=>({width:"32px",height:"32px",borderRadius:"50%",background:a.value,border:n.value,display:"flex",justifyContent:"center",alignItems:"center",color:"white",fontWeight:"bold",fontSize:"14px"})},()=>r.value?"✓":String(t+1)),e=x.span(e,{style:()=>({marginLeft:"8px",color:o.value?"white":"#94a3b8",fontSize:"13px",fontWeight:"600"})});l.appendChild(x.flex.row({align:"center",style:{flex:1}},i,e))}),l},x.menu=(t,e)=>{if(t){let r=null;t.style.position="relative";t.addEventListener("click",()=>{r?(r.remove(),r=null):(r=x.div(".dropdown-menu",{style:{position:"absolute",top:"100%",left:"0",marginTop:"8px",minWidth:"160px",background:"#0f172a",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden"}}),e.forEach(e=>{let t=x.button(e.text,{style:{width:"100%",textAlign:"left",padding:"10px 16px",fontSize:"13px",background:"transparent",border:"none",color:"#cbd5e1",cursor:"pointer"},onclick:()=>{e.onclick(),r.remove(),r=null}});t.addEventListener("mouseenter",()=>t.style.background="rgba(255,255,255,0.04)"),t.addEventListener("mouseleave",()=>t.style.background="transparent"),r.appendChild(t)}),t.appendChild(r))}),document.addEventListener("click",e=>{r&&!t.contains(e.target)&&(r.remove(),r=null)})}},x.dropdown=(e={})=>{let{items:t=[],placeholder:r="Select item",onSelect:o=null}=e,a=x.state(r),n=x.state(!1),i=x.div(".dropdown-container",{style:{position:"relative",width:"100%"}});e=x.button({style:{width:"100%",textAlign:"left",display:"flex",justifyContent:"space-between",alignItems:"center",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.02)",color:"white",padding:"10px 14px"},onclick:()=>n.value=!n.value},x.span(()=>a.value),x.span(()=>n.value?"▲":"▼"));let s=x.div({style:()=>({display:n.value?"block":"none",position:"absolute",top:"100%",left:0,right:0,marginTop:"4px",background:"#0f172a",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"8px",zIndex:1e3,maxHeight:"200px",overflowY:"auto"})});return t.forEach(e=>{let t=x.div(e,{style:{padding:"10px 14px",cursor:"pointer",color:"#cbd5e1",fontSize:"14px"},onclick:()=>{a.value=e,n.value=!1,o&&o(e)}});t.addEventListener("mouseenter",()=>t.style.background="rgba(255,255,255,0.04)"),t.addEventListener("mouseleave",()=>t.style.background="transparent"),s.appendChild(t)}),i.appendChild(e),i.appendChild(s),document.addEventListener("click",e=>{i.contains(e.target)||(n.value=!1)}),i},x.emptyState=(e={})=>{var{title:e="No results found",description:t="Try adjusting your search criteria or filters.",icon:r="search"}=e;return x.flex.col({align:"center",style:{padding:"48px 24px",textAlign:"center",background:"rgba(255,255,255,0.01)",border:"1px dashed rgba(255,255,255,0.1)",borderRadius:"16px",gap:"12px"}},x.icon(r,{size:36,color:"#94a3b8"}),x.h3(e,{style:{margin:0,color:"white",fontSize:"16px",fontWeight:"700"}}),x.p(t,{style:{margin:0,color:"#94a3b8",fontSize:"13px",maxWidth:"320px",lineHeight:"1.5"}}))},x.skeletonLoader=(e={})=>{var{type:t="card",count:r=1}=e,o=x.div(".skeleton-loader-container",{style:{display:"flex",flexDirection:"column",gap:"12px",width:"100%"}}),a="background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%); background-size: 200% 100%; animation: papyr-skeleton-shine 1.5s infinite;";"undefined"==typeof document||document.getElementById("papyr-skeleton-styles")||((e=document.createElement("style")).id="papyr-skeleton-styles",e.textContent=`
28
+ @keyframes papyr-skeleton-shine {
29
+ 0% { background-position: 200% 0; }
30
+ 100% { background-position: -200% 0; }
31
+ }
32
+ `,document.head.appendChild(e));for(let e=0;e<r;e++)"card"===t?o.appendChild(x.div(".skeleton-card",{style:{background:"rgba(255,255,255,0.01)",border:"1px solid rgba(255,255,255,0.06)",borderRadius:"16px",padding:"20px",display:"flex",flexDirection:"column",gap:"12px"}},x.div({style:"width: 60px; height: 12px; border-radius: 4px; "+a}),x.div({style:"width: 100%; height: 16px; border-radius: 4px; "+a}),x.div({style:"width: 80%; height: 16px; border-radius: 4px; "+a}))):o.appendChild(x.div({style:"width: 100%; height: 20px; border-radius: 4px; "+a}));return o},x.calendar=(e={})=>{let{onSelect:r=null}=e;e=new Date;let o=x.state(e.getFullYear()),a=x.state(e.getMonth()),t=["January","February","March","April","May","June","July","August","September","October","November","December"],n=x.div({style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:"6px",textAlign:"center",marginTop:"12px"}}),i=()=>{n.innerHTML="",["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(e=>n.appendChild(x.span(e,{style:{color:"#64748b",fontSize:"11px",fontWeight:"bold"}})));var t=new Date(o.value,a.value,1).getDay(),e=new Date(o.value,a.value+1,0).getDate();for(let e=0;e<t;e++)n.appendChild(x.span(""));for(let t=1;t<=e;t++){let e=x.button(String(t),{style:{padding:"6px",fontSize:"12px",background:"transparent",border:"none",borderRadius:"6px",color:"white",cursor:"pointer"},onclick:()=>{var e=new Date(o.value,a.value,t);r&&r(e)}});e.addEventListener("mouseenter",()=>e.style.background="#6366f1"),e.addEventListener("mouseleave",()=>e.style.background="transparent"),n.appendChild(e)}};var e=x.button("▶",{style:{background:"transparent",border:"none",color:"white",cursor:"pointer"},onclick:()=>{a.value=(a.value+1)%12,0===a.value&&o.value++,i()}}),s=x.button("◀",{style:{background:"transparent",border:"none",color:"white",cursor:"pointer"},onclick:()=>{a.value=(a.value-1+12)%12,11===a.value&&o.value--,i()}}),l=x.span(()=>t[a.value]+" "+o.value,{style:{fontWeight:"bold",color:"white"}}),s=x.flex.between({style:{padding:"4px"}},s,l,e),l=x.div(".papyr-calendar",{style:{padding:"16px",background:"#0f172a",border:"1px solid rgba(255,255,255,0.08)",borderRadius:"12px",maxWidth:"260px"}},s,n);return i(),l},x.datePicker=(e={})=>{let{placeholder:t="Select Date",onSelect:r=null}=e,o=x.state(!1),a=x.state(""),n=x.div(".date-picker-container",{style:{position:"relative",width:"100%"}});var e=x.input("text",t,{value:()=>a.value,onclick:()=>o.value=!o.value,style:{cursor:"pointer"}}),i=x.div({style:()=>({display:o.value?"block":"none",position:"absolute",top:"100%",left:0,marginTop:"8px",zIndex:2e3})},x.calendar({onSelect:e=>{var t=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-`+String(e.getDate()).padStart(2,"0");a.value=t,o.value=!1,r&&r(e)}}));return n.appendChild(e),n.appendChild(i),document.addEventListener("click",e=>{n.contains(e.target)||(o.value=!1)}),n};{let t="undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=null,i=("undefined"!=typeof window&&"IntersectionObserver"in window&&(n=new IntersectionObserver(e=>{e.forEach(e=>{var t;e.isIntersecting?((t=e.target.dataset.animate)&&(e.target.classList.add("animate-"+t),e.target.classList.add("animated")),"false"!==e.target.dataset.animateOnce&&n.unobserve(e.target)):"false"===e.target.dataset.animateOnce&&(t=e.target.dataset.animate)&&(e.target.classList.remove("animate-"+t),e.target.classList.remove("animated"))})},{threshold:.1})),["fade","slide","zoom","blur","rotate","bounce","elastic","glass-pop","fade-in","slide-up","slide-down","zoom-in","blur-in"]),e=null;"undefined"!=typeof window&&"MutationObserver"in window&&(e=new MutationObserver(e=>{t||e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&[e,...e.querySelectorAll("[animate]")].forEach(e=>{if(e.hasAttribute("animate")&&n){var r=e.getAttribute("animate");if(!i.includes(r)){let e="",t=1/0;for(var o of i){var a=((r,o)=>{var a=[];for(let e=0;e<=o.length;e++)a[e]=[e];for(let e=0;e<=r.length;e++)a[0][e]=e;for(let t=1;t<=o.length;t++)for(let e=1;e<=r.length;e++)o.charAt(t-1)==r.charAt(e-1)?a[t][e]=a[t-1][e-1]:a[t][e]=Math.min(a[t-1][e-1]+1,Math.min(a[t][e-1]+1,a[t-1][e]+1));return a[o.length][r.length]})(r,o);a<t&&(t=a,e=o)}t<=3&&(console.error(`PapyrError: Unknown animation "${r}". Did you mean "${e}"?`),x.toast)&&x.toast(`PapyrError: Unknown animation "${r}". Did you mean "${e}"?`,"error")}e.dataset.animate=r,e.removeAttribute("animate"),e.classList.add("papyr-animate-base"),n.observe(e)}})})})})),"undefined"!=typeof document&&e&&e.observe(document.body||document.documentElement,{childList:!0,subtree:!0}),x,x.animate=(e,t,r=400)=>{if(!e)return null;if("object"==typeof e&&!(e instanceof Element)){let t=e;return e=>(e&&"glass-pop"===t.type&&(e.classList.add("animate-glass-pop"),e.classList.add("papyr-animate-base")),e)}let o=e;return t&&"object"==typeof t&&(o.style.transition=`all ${r}ms cubic-bezier(0.4, 0, 0.2, 1)`,requestAnimationFrame(()=>{Object.assign(o.style,t)})),o},x.animate.fade=(e,t=600)=>(e&&(e.style.opacity="0",e.style.transition=`opacity ${t}ms cubic-bezier(0.4, 0, 0.2, 1)`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.opacity="1"})})),e),x.animate.slide=(e,t=600)=>(e&&(e.style.opacity="0",e.style.transform="translateY(30px)",e.style.transition=`opacity ${t}ms cubic-bezier(0.4, 0, 0.2, 1), transform ${t}ms cubic-bezier(0.4, 0, 0.2, 1.15)`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="translateY(0px)"})})),e),x.animate.zoom=(e,t=600)=>(e&&(e.style.opacity="0",e.style.transform="scale(0.9)",e.style.transition=`opacity ${t}ms cubic-bezier(0.4, 0, 0.2, 1), transform ${t}ms cubic-bezier(0.4, 0, 0.2, 1.15)`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="scale(1)"})})),e),x.animate.pop=(e,t=600)=>(e&&(e.style.opacity="0",e.style.transform="scale(0.3)",e.style.transition=`opacity ${t}ms ease, transform ${t}ms cubic-bezier(0.34, 1.56, 0.64, 1)`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.opacity="1",e.style.transform="scale(1)"})})),e),x.animate.spring=(a,e,t={})=>{if(!a||"undefined"==typeof window)return a;let{tension:n=170,friction:i=26,mass:s=1}=t,r=(a._springCancel&&a._springCancel(),!1),l=(a._springCancel=()=>{r=!0},0),d=0,p=1;var t=a.style.transform||"",o=t.match(/translate\(([^,]+),\s*([^)]+)\)/)||t.match(/translate3d\(([^,]+),\s*([^,]+)/),o=(o?(l=parseFloat(o[1])||0,d=parseFloat(o[2])||0):((o=t.match(/translateX\(([^)]+)\)/))&&(l=parseFloat(o[1])||0),(o=t.match(/translateY\(([^)]+)\)/))&&(d=parseFloat(o[1])||0)),t.match(/scale\(([^)]+)\)/));o&&(p=parseFloat(o[1])||1);let c={},u=(Object.entries(e).forEach(([t,r])=>{if("__proto__"!==t&&"constructor"!==t&&"prototype"!==t){let e=0;e="x"===t?l:"y"===t?d:"scale"===t?p:parseFloat(a.style[t])||0,c[t]={current:e,velocity:0,target:r}}}),()=>{if(!r){let r=!0;Object.entries(c).forEach(([,e])=>{var t=(-n*(e.current-e.target)-i*e.velocity)/s;e.velocity+=.016*t,e.current+=.016*e.velocity,.01<Math.abs(e.velocity)||.01<Math.abs(e.current-e.target)?r=!1:e.current=e.target});var e=[],t="x"in c,o="y"in c;t||o?(t=t?c.x.current:l,o=o?c.y.current:d,e.push(`translate(${t}px, ${o}px)`)):0===l&&0===d||e.push(`translate(${l}px, ${d}px)`),"scale"in c?e.push(`scale(${c.scale.current})`):1!==p&&e.push(`scale(${p})`),0<e.length&&(a.style.transform=e.join(" ")),Object.entries(c).forEach(([e,t])=>{"x"!==e&&"y"!==e&&"scale"!==e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(a.style[e]="opacity"===e?t.current:t.current+"px")}),r||requestAnimationFrame(u)}});return u(),a},x.animate.gesture=(c,u={})=>{if(c&&"undefined"!=typeof window){let{onSwipeLeft:e,onSwipeRight:t,onDrag:r,onRelease:o}=u,a=0,n=0,i=0,s=0,l=!1,d=(e,t)=>{a=e,n=t,l=!0,c.style.transition="none"},p=(e,t)=>{l&&(i=e-a,s=t-n,r?r(i,s,c):c.style.transform=`translate(${i}px, ${s}px)`)};u=()=>{l&&(l=!1,o?o(i,s,c):(c.style.transition="transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275)",100<i&&t?t(c):i<-100&&e?e(c):c.style.transform="translate(0px, 0px)"),i=0,s=0)};c.addEventListener("mousedown",e=>d(e.clientX,e.clientY)),window.addEventListener("mousemove",e=>p(e.clientX,e.clientY)),window.addEventListener("mouseup",u),c.addEventListener("touchstart",e=>d(e.touches[0].clientX,e.touches[0].clientY)),c.addEventListener("touchmove",e=>p(e.touches[0].clientX,e.touches[0].clientY)),c.addEventListener("touchend",u)}return c},x.parallax=(t,o=.5)=>{"undefined"!=typeof window&&window.addEventListener("scroll",()=>{var e=document.querySelectorAll(t);let r=window.scrollY;e.forEach(e=>{var t=-r*o;e.style.transform=`translateY(${t}px)`})})},x.physics=(e={})=>{let{gravity:s=.98,bounce:l=.8,friction:d=.95}=e;return i=>{if(i&&"undefined"!=typeof window){let t=0,r=0,o=!1,a,n=()=>{var e;o||(r+=s,t+=r,e=(i.parentElement?i.parentElement.clientHeight:window.innerHeight)-i.offsetHeight,t>e&&(t=e,r=(r*=-l)*d),i.style.transform=`translateY(${t}px)`),a=requestAnimationFrame(n)};i.style.cursor="grab",i.addEventListener("mousedown",()=>{o=!0,i.style.cursor="grabbing"}),window.addEventListener("mouseup",()=>{o&&(o=!1,i.style.cursor="grab",r=0)}),window.addEventListener("mousemove",e=>{o&&(t+=e.movementY,i.style.transform=`translateY(${t}px)`)}),setTimeout(()=>{var e=i.getBoundingClientRect();t=e.top||0,n()},50)}return i}}}{let e="undefined"!=typeof window&&window.papyr||"undefined"!=typeof global&&global.papyr;if(e){let s=(t,r)=>{if(t&&"function"==typeof t.getContext){let d=t.getContext("2d");if(d){var p=t.width;let l=t.height;if(0!==p&&0!==l){d.clearRect(0,0,p,l);t=r.type||"bar";let e=r.data;e&&"function"==typeof e.subscribe?e=e.value:r.value&&"function"==typeof r.value.subscribe&&(e=r.value.value);var c=e||[];let s=r.colors||["#6366f1","#14b8a6","#f43f5e","#f59e0b","#8b5cf6"];if("bar"===t){let n=(p-80)/(c.length||1)-10;var o=c.map(e=>"object"==typeof e?e.value:e);let i=0<o.length?Math.max(...o):1;c.forEach((e,t)=>{var r="object"==typeof e?e.value:e,e="object"==typeof e?e.label:"",r=r/(i||1)*(l-80),o=40+t*(10+n),a=l-40-r;d.fillStyle=s[t%s.length],d.beginPath(),d.roundRect?d.roundRect(o,a,n,r,[4,4,0,0]):d.rect(o,a,n,r),d.fill(),e&&(d.fillStyle="#cbd5e1",d.font="12px sans-serif",d.textAlign="center",d.fillText(e,o+n/2,l-40+20))})}else if("circle"===t||"pie"===t){let a=p/2,n=l/2,i=Math.min(a,n)-20;if("circle"===t){o=("function"==typeof r.value?r.value():void 0!==r.value?r.value:0)/(r.max||100||1);d.beginPath(),d.arc(a,n,i,0,2*Math.PI),d.strokeStyle="rgba(255,255,255,0.05)",d.lineWidth=15,d.stroke(),d.beginPath(),d.arc(a,n,i,-Math.PI/2,-Math.PI/2+2*Math.PI*o),d.strokeStyle=s[0],d.lineCap="round",d.lineWidth=15,d.stroke(),d.fillStyle="#fff",d.font="bold 24px sans-serif",d.textAlign="center",d.textBaseline="middle",d.fillText(Math.round(100*o)+"%",a,n)}else if("pie"===t){let r=c.reduce((e,t)=>e+("object"==typeof t?t.value:t),0),o=-Math.PI/2;c.forEach((e,t)=>{e=("object"==typeof e?e.value:e)/(r||1)*Math.PI*2;d.beginPath(),d.moveTo(a,n),d.arc(a,n,i,o,o+e),d.closePath(),d.fillStyle=s[t%s.length],d.fill(),o+=e})}}else if("line"===t){r=c.map(e=>"object"==typeof e?e.value:e);let o=0<r.length?Math.max(...r):1,a=(p-80)/(c.length-1||1);d.beginPath(),d.strokeStyle=s[0],d.lineWidth=3,d.lineJoin="round",c.forEach((e,t)=>{var e="object"==typeof e?e.value:e,r=40+t*a,e=l-40-e/(o||1)*(l-80);0===t?d.moveTo(r,e):d.lineTo(r,e)}),d.stroke()}}}}},l=e.chart;e.chart=(t,r,o={})=>{if("string"==typeof t){if("function"==typeof l)return l(t,r,o);if("undefined"==typeof document)return{tagName:"canvas",isMock:!0};let e=document.createElement("canvas");return e.width=o.width||300,e.height=o.height||180,e}if("undefined"==typeof document)return{tagName:"div",className:"papyr-chart-container",isMock:!0};let a=t||{},n=document.createElement("canvas"),i=e.div(".papyr-chart-container",n,Object.assign({style:{position:"relative",width:"100%",height:"300px"}},a.attrs||{}));if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver(e=>{for(var t of e){t=t.contentRect;n.width=t.width||300,n.height=t.height||300,s(n,a)}});setTimeout(()=>{e.observe(i),s(n,a)},0)}else setTimeout(()=>{n.width=300,n.height=300,s(n,a)},0);r=a.data&&"function"==typeof a.data.subscribe?a.data:a.value&&"function"==typeof a.value.subscribe?a.value:null;return r&&r.subscribe(()=>{"undefined"!=typeof requestAnimationFrame?requestAnimationFrame(()=>s(n,a)):s(n,a)}),i},e.charts=(e,t)=>{if("undefined"==typeof document)return null;let r="string"==typeof e?document.getElementById(e)||document.querySelector(e):e;if(!r)return console.error("PapyrCharts Error: Canvas element not found: "+e),null;let o=()=>{s(r,t)};e=t.data&&"function"==typeof t.data.subscribe?t.data:t.value&&"function"==typeof t.value.subscribe?t.value:null;if(e&&e.subscribe(()=>{"undefined"!=typeof requestAnimationFrame?requestAnimationFrame(o):o()}),"undefined"!=typeof ResizeObserver){let e=new ResizeObserver(e=>{for(var t of e){t=t.contentRect;r.width=t.width||r.clientWidth||300,r.height=t.height||r.clientHeight||150,o()}});setTimeout(()=>{e.observe(r.parentElement||r),o()},0)}else setTimeout(o,0);return r}}else console.warn("Papyr core not found. Load papyr.js before loading charts plugin.")}"undefined"!=typeof document&&((r=document.createElement("style")).id="papyr-complete-styles",r.textContent=`
33
+ :root {
34
+ --papyr-primary: #6366f1;
35
+ --papyr-primary-hover: #4f46e5;
36
+ --papyr-primary-light: rgba(99, 102, 241, 0.15);
37
+ --papyr-bg: #0f172a;
38
+ --papyr-surface: #1e293b;
39
+ --papyr-border: #334155;
40
+ --papyr-text: #f8fafc;
41
+ --papyr-text-muted: #94a3b8;
42
+ --papyr-success: #10b981;
43
+ --papyr-error: #ef4444;
44
+ --papyr-info: #0ea5e9;
45
+ --papyr-radius: 12px;
46
+ --papyr-font: system-ui, -apple-system, sans-serif;
47
+ }
48
+
49
+ /* Flexbox System */
50
+ .flex-row { display: flex; flex-direction: row; gap: 1rem; }
51
+ .flex-col { display: flex; flex-direction: column; gap: 1rem; }
52
+ .flex-center { display: flex; justify-content: center; align-items: center; gap: 1rem; }
53
+ .flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
54
+ .flex-around { display: flex; justify-content: space-around; align-items: center; gap: 1rem; }
55
+ .flex-wrap { display: flex; flex-wrap: wrap; gap: 1rem; }
56
+
57
+ /* Grid System */
58
+ .grid { display: grid; gap: 1.5rem; }
59
+
60
+ /* Cards */
61
+ .card {
62
+ background: var(--papyr-surface);
63
+ border: 1px solid var(--papyr-border);
64
+ border-radius: var(--papyr-radius);
65
+ padding: 1.5rem;
66
+ box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
67
+ }
68
+ .card-title { margin-top: 0; margin-bottom: 0.75rem; color: var(--papyr-text); }
69
+ .card-content { color: var(--papyr-text-muted); font-size: 0.95rem; }
70
+ .card-footer { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--papyr-border); color: var(--papyr-text-muted); font-size: 0.85rem; }
71
+
72
+ /* Buttons */
73
+ .btn-primary {
74
+ background: var(--papyr-primary);
75
+ color: white;
76
+ border: none;
77
+ padding: 10px 20px;
78
+ border-radius: 8px;
79
+ font-weight: 600;
80
+ cursor: pointer;
81
+ transition: background 0.2s;
82
+ }
83
+ .btn-primary:hover { background: var(--papyr-primary-hover); }
84
+
85
+ /* Inputs */
86
+ input[type="text"], input[type="email"], input[type="password"], textarea, select {
87
+ background: var(--papyr-bg);
88
+ border: 1px solid var(--papyr-border);
89
+ border-radius: 8px;
90
+ padding: 10px 14px;
91
+ color: var(--papyr-text);
92
+ font-family: inherit;
93
+ outline: none;
94
+ width: 100%;
95
+ transition: border-color 0.2s;
96
+ }
97
+ input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
98
+ border-color: var(--papyr-primary);
99
+ }
100
+
101
+ /* Forms */
102
+ .papyr-form { display: flex; flex-direction: column; gap: 1.25rem; }
103
+ .form-field { display: flex; flex-direction: column; gap: 0.5rem; }
104
+ .form-field label { font-size: 0.85rem; font-weight: 600; color: var(--papyr-text-muted); }
105
+
106
+ /* Table styling */
107
+ .data-table { width: 100%; border-collapse: collapse; text-align: left; }
108
+ .data-table th, .data-table td { padding: 12px 16px; border-bottom: 1px solid var(--papyr-border); }
109
+ .data-table th { background: var(--papyr-surface); color: var(--papyr-text); font-weight: 600; }
110
+ .data-table td { color: var(--papyr-text-muted); }
111
+
112
+ /* Suggestions autocomplete */
113
+ .autocomplete { position: relative; width: 100%; }
114
+ .suggestions {
115
+ position: absolute; top: 100%; left: 0; right: 0;
116
+ background: var(--papyr-surface); border: 1px solid var(--papyr-border);
117
+ border-radius: 8px; list-style: none; padding: 0; margin: 4px 0 0 0;
118
+ z-index: 1000; max-height: 200px; overflow-y: auto;
119
+ }
120
+ .suggestions li { padding: 10px 14px; cursor: pointer; color: var(--papyr-text-muted); }
121
+ .suggestions li:hover { background: var(--papyr-bg); color: var(--papyr-text); }
122
+
123
+ /* Modal styles */
124
+ .modal {
125
+ position: fixed; top: 0; left: 0; width: 100%; height: 100%;
126
+ background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(4px);
127
+ display: flex; justify-content: center; align-items: center; z-index: 2000;
128
+ opacity: 0; transition: opacity 0.3s ease;
129
+ }
130
+ .modal-show { opacity: 1; }
131
+ .modal-content {
132
+ background: var(--papyr-surface); border: 1px solid var(--papyr-border);
133
+ border-radius: var(--papyr-radius); width: 90%; max-width: 500px;
134
+ transform: translateY(20px); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
135
+ }
136
+ .modal-show .modal-content { transform: translateY(0); }
137
+ .modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--papyr-border); display: flex; justify-content: space-between; align-items: center; }
138
+ .modal-header h3 { margin: 0; color: var(--papyr-text); }
139
+ .close-btn { background: none; border: none; font-size: 1.5rem; color: var(--papyr-text-muted); cursor: pointer; }
140
+ .close-btn:hover { color: var(--papyr-text); }
141
+ .modal-body { padding: 1.5rem; color: var(--papyr-text-muted); }
142
+
143
+ /* Toasts notifications */
144
+ .toast {
145
+ position: fixed; bottom: 20px; right: 20px;
146
+ background: var(--papyr-surface); border: 1px solid var(--papyr-border);
147
+ border-radius: 8px; padding: 12px 20px; color: var(--papyr-text);
148
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3); z-index: 3000;
149
+ transform: translateY(100px); opacity: 0; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
150
+ }
151
+ .toast-show { transform: translateY(0); opacity: 1; }
152
+ .toast-hide { transform: translateY(-100px); opacity: 0; }
153
+ .toast-success { border-left: 4px solid var(--papyr-success); }
154
+ .toast-error { border-left: 4px solid var(--papyr-error); }
155
+ .toast-info { border-left: 4px solid var(--papyr-info); }
156
+
157
+ /* Tab components */
158
+ .tabs { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
159
+ .tab-headers { display: flex; border-bottom: 1px solid var(--papyr-border); gap: 4px; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
160
+ .tab-headers::-webkit-scrollbar { display: none; }
161
+ .tab-header {
162
+ background: none; border: none; border-bottom: 2px solid transparent;
163
+ padding: 10px 16px; color: var(--papyr-text-muted); cursor: pointer; font-weight: 600;
164
+ transition: all 0.2s;
165
+ }
166
+ .tab-header:hover { color: var(--papyr-text); }
167
+ .tab-active { color: var(--papyr-primary); border-bottom-color: var(--papyr-primary); }
168
+ .tab-contents { color: var(--papyr-text-muted); line-height: 1.5; }
169
+
170
+ /* Loader components */
171
+ .loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 2rem; color: var(--papyr-text-muted); }
172
+ .spinner {
173
+ width: 32px; height: 32px; border: 3px solid var(--papyr-primary-light);
174
+ border-top-color: var(--papyr-primary); border-radius: 50%; animation: spin 0.8s linear infinite;
175
+ }
176
+ @keyframes spin { to { transform: rotate(360deg); } }
177
+
178
+ /* Sidebars catalog navigation */
179
+ .sidebar { display: flex; flex-direction: column; gap: 4px; }
180
+ .sidebar-item {
181
+ padding: 10px 14px; border-radius: 6px; cursor: pointer;
182
+ color: var(--papyr-text-muted); transition: all 0.2s;
183
+ }
184
+ .sidebar-item:hover { background: var(--papyr-primary-light); color: var(--papyr-text); }
185
+ .sidebar-item.active { background: var(--papyr-primary); color: white; }
186
+
187
+ /* Image carousel */
188
+ .carousel { position: relative; width: 100%; overflow: hidden; border-radius: var(--papyr-radius); border: 1px solid var(--papyr-border); aspect-ratio: 16/9; }
189
+ .carousel-img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.2s ease-in-out; }
190
+ .carousel-btn {
191
+ position: absolute; top: 50%; transform: translateY(-50%);
192
+ background: rgba(15, 23, 42, 0.6); border: 1px solid var(--papyr-border);
193
+ color: white; width: 36px; height: 36px; border-radius: 50%;
194
+ cursor: pointer; display: flex; justify-content: center; align-items: center; z-index: 10;
195
+ transition: background 0.2s;
196
+ }
197
+ .carousel-btn:hover { background: var(--papyr-primary); }
198
+ .prev-btn { left: 10px; }
199
+ .next-btn { right: 10px; }
200
+ .carousel-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
201
+ .carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; }
202
+ .carousel-dot.active { background: white; width: 18px; border-radius: 4px; }
203
+
204
+ /* ==========================================
205
+ BOOTSTRAP SPECIFICITY OVERRIDES
206
+ ========================================== */
207
+ :root, [data-bs-theme="dark"] {
208
+ --bs-body-bg: var(--papyr-bg, #0f172a) !important;
209
+ --bs-body-color: var(--papyr-text, #f8fafc) !important;
210
+ --bs-tertiary-bg: var(--papyr-surface, #1e293b) !important;
211
+ --bs-card-bg: var(--papyr-surface, #1e293b) !important;
212
+ --bs-card-color: var(--papyr-text, #f8fafc) !important;
213
+ --bs-border-color: var(--papyr-border, #334155) !important;
214
+ }
215
+
216
+ .card {
217
+ background: var(--papyr-surface, #1e293b) !important;
218
+ border: 1px solid var(--papyr-border, #334155) !important;
219
+ border-radius: var(--papyr-radius, 12px) !important;
220
+ }
221
+
222
+ /* PAPYR ANIMATE CSS */
223
+ .papyr-animate-base {
224
+ opacity: 0;
225
+ will-change: transform, opacity;
226
+ animation-duration: 0.8s;
227
+ animation-timing-function: cubic-bezier(0.165, 0.84, 0.44, 1);
228
+ animation-fill-mode: forwards;
229
+ }
230
+
231
+ .animated {
232
+ opacity: 1; /* fallback if animation fails */
233
+ }
234
+
235
+ /* Entrance Animations */
236
+ .animate-fade-in { animation-name: papyr-fade-in; }
237
+ @keyframes papyr-fade-in {
238
+ from { opacity: 0; }
239
+ to { opacity: 1; }
240
+ }
241
+
242
+ .animate-slide-up { animation-name: papyr-slide-up; }
243
+ @keyframes papyr-slide-up {
244
+ from { opacity: 0; transform: translateY(40px); }
245
+ to { opacity: 1; transform: translateY(0); }
246
+ }
247
+
248
+ .animate-slide-down { animation-name: papyr-slide-down; }
249
+ @keyframes papyr-slide-down {
250
+ from { opacity: 0; transform: translateY(-40px); }
251
+ to { opacity: 1; transform: translateY(0); }
252
+ }
253
+
254
+ .animate-zoom-in { animation-name: papyr-zoom-in; }
255
+ @keyframes papyr-zoom-in {
256
+ from { opacity: 0; transform: scale(0.85); }
257
+ to { opacity: 1; transform: scale(1); }
258
+ }
259
+
260
+ .animate-bounce { animation-name: papyr-bounce; animation-timing-function: cubic-bezier(0.28, 0.84, 0.42, 1); }
261
+ @keyframes papyr-bounce {
262
+ 0% { opacity: 0; transform: scale(0.3); }
263
+ 50% { opacity: 1; transform: scale(1.05); }
264
+ 70% { transform: scale(0.9); }
265
+ 100% { opacity: 1; transform: scale(1); }
266
+ }
267
+
268
+ /* Interactive Hover Animations */
269
+ .hover-grow {
270
+ transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
271
+ }
272
+ .hover-grow:hover {
273
+ transform: scale(1.05);
274
+ }
275
+
276
+ .hover-lift {
277
+ transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s;
278
+ }
279
+ .hover-lift:hover {
280
+ transform: translateY(-5px);
281
+ box-shadow: 0 10px 25px rgba(0,0,0,0.3);
282
+ }
283
+
284
+ /* Reduce motion accessibility */
285
+ @media (prefers-reduced-motion: reduce) {
286
+ .papyr-animate-base, .hover-grow, .hover-lift {
287
+ animation: none !important;
288
+ transition: none !important;
289
+ transform: none !important;
290
+ opacity: 1 !important;
291
+ }
292
+ }
293
+
294
+
295
+ /* Papyr.js Responsive Grid System */
296
+ .container { width: 100%; margin-right: auto; margin-left: auto; padding-right: 15px; padding-left: 15px; }
297
+ @media (min-width: 576px) { .container { max-width: 540px; } }
298
+ @media (min-width: 768px) { .container { max-width: 720px; } }
299
+ @media (min-width: 992px) { .container { max-width: 960px; } }
300
+ @media (min-width: 1200px) { .container { max-width: 1140px; } }
301
+
302
+ .row { display: flex; flex-wrap: wrap; margin-right: -15px; margin-left: -15px; }
303
+ .col { flex-basis: 0; flex-grow: 1; max-width: 100%; padding-right: 15px; padding-left: 15px; }
304
+
305
+ /* Grid Columns */
306
+ .col-12 { flex: 0 0 100%; max-width: 100%; padding-right: 15px; padding-left: 15px; }
307
+ .col-6 { flex: 0 0 50%; max-width: 50%; padding-right: 15px; padding-left: 15px; }
308
+ .col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; padding-right: 15px; padding-left: 15px; }
309
+ .col-3 { flex: 0 0 25%; max-width: 25%; padding-right: 15px; padding-left: 15px; }
310
+
311
+ @media (min-width: 768px) {
312
+ .col-md-12 { flex: 0 0 100%; max-width: 100%; }
313
+ .col-md-6 { flex: 0 0 50%; max-width: 50%; }
314
+ .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
315
+ .col-md-3 { flex: 0 0 25%; max-width: 25%; }
316
+ }
317
+
318
+ @media (min-width: 992px) {
319
+ .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
320
+ .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
321
+ .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
322
+ .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
323
+ }
324
+
325
+ /* Flex Utilities */
326
+ .flex { display: flex; }
327
+ .flex-column { flex-direction: column; }
328
+ .align-center { align-items: center; }
329
+ .justify-center { justify-content: center; }
330
+ .justify-between { justify-content: space-between; }
331
+ .wrap { flex-wrap: wrap; }
332
+ .gap-1 { gap: 0.5rem; }
333
+ .gap-2 { gap: 1rem; }
334
+ .gap-3 { gap: 1.5rem; }
335
+
336
+ /* Global Typography & Adjustments for Mobile */
337
+ @media (max-width: 768px) {
338
+ body { font-size: 14px; }
339
+ h1 { font-size: 2rem !important; }
340
+ h2 { font-size: 1.5rem !important; }
341
+ .hero { padding: 3rem 1rem !important; }
342
+ .hero-buttons { flex-direction: column; gap: 1rem; width: 100%; }
343
+ .hero-buttons > * { width: 100%; text-align: center; justify-content: center; }
344
+ .stat-item { width: 100% !important; margin-bottom: 1rem; }
345
+ .api-grid { grid-template-columns: 1fr !important; }
346
+ #playground-split { flex-direction: column !important; }
347
+ #editor-pane, #preview-pane { width: 100% !important; border-right: none !important; border-bottom: 1px solid var(--border-color); }
348
+ .catalog-sidebar { width: 100% !important; border-right: none !important; border-bottom: 1px solid var(--border-color); }
349
+ .playground-body { flex-direction: column !important; }
350
+ }
351
+ \\n
352
+ /* Docs Layout */
353
+ .docs-container {
354
+ display: flex;
355
+ min-height: 100vh;
356
+ }
357
+ .sidebar {
358
+ width: 250px;
359
+ background: #0a0f1c;
360
+ border-right: 1px solid var(--border-color);
361
+ padding: 2rem 0;
362
+ position: sticky;
363
+ top: 0;
364
+ height: 100vh;
365
+ overflow-y: auto;
366
+ flex-shrink: 0;
367
+ }
368
+ .sidebar-link {
369
+ display: block;
370
+ padding: 0.5rem 1.5rem;
371
+ color: var(--text-muted);
372
+ text-decoration: none;
373
+ transition: all 0.2s;
374
+ font-size: 0.9rem;
375
+ }
376
+ .sidebar-link:hover {
377
+ color: #fff;
378
+ background: rgba(255,255,255,0.05);
379
+ }
380
+ .sidebar-link.active {
381
+ color: var(--primary);
382
+ background: rgba(99, 102, 241, 0.1);
383
+ border-right: 3px solid var(--primary);
384
+ }
385
+ .docs-content {
386
+ flex-grow: 1;
387
+ padding: 3rem 4rem;
388
+ max-width: 900px;
389
+ }
390
+
391
+ @media (max-width: 768px) {
392
+ .docs-container {
393
+ flex-direction: column;
394
+ }
395
+ .sidebar {
396
+ width: 100%;
397
+ height: auto;
398
+ position: relative;
399
+ border-right: none;
400
+ border-bottom: 1px solid var(--border-color);
401
+ padding: 1rem 0;
402
+ }
403
+ .docs-content {
404
+ padding: 2rem 1.5rem;
405
+ }
406
+ }
407
+
408
+ .crud-grid {
409
+ display: grid;
410
+ grid-template-columns: 300px 1fr;
411
+ gap: 2rem;
412
+ }
413
+ @media (max-width: 768px) {
414
+ .crud-grid {
415
+ grid-template-columns: 1fr;
416
+ }
417
+ }
418
+
419
+ .responsive-split-grid {
420
+ display: grid;
421
+ grid-template-columns: 1fr 1fr;
422
+ gap: 2rem;
423
+ }
424
+ @media (max-width: 768px) {
425
+ .responsive-split-grid {
426
+ grid-template-columns: 1fr;
427
+ }
428
+ }
429
+
430
+ /* Custom animations for papyr complete */
431
+ @keyframes papyr-blur-in {
432
+ 0% { opacity: 0; filter: blur(12px); transform: translateY(20px); }
433
+ 100% { opacity: 1; filter: blur(0); transform: translateY(0); }
434
+ }
435
+ @keyframes papyr-glass-pop {
436
+ 0% { opacity: 0; transform: scale(0.93) translateY(15px); }
437
+ 70% { transform: scale(1.01) translateY(-2px); }
438
+ 100% { opacity: 1; transform: scale(1) translateY(0); }
439
+ }
440
+
441
+ .animate-blur-in { animation-name: papyr-blur-in; }
442
+ .animate-glass-pop { animation-name: papyr-glass-pop; }
443
+
444
+ /* ==========================================
445
+ WATT PRIVACY BANNER AND CONSENT COMPONENTS
446
+ ========================================== */
447
+ .watt-banner-pill {
448
+ position: fixed;
449
+ bottom: 24px;
450
+ left: 50%;
451
+ transform: translateX(-50%) translateY(100px);
452
+ background: rgba(13, 17, 34, 0.85);
453
+ border: 1px solid rgba(20, 184, 166, 0.25);
454
+ box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(20, 184, 166, 0.1);
455
+ border-radius: 99px;
456
+ padding: 12px 24px;
457
+ display: flex;
458
+ align-items: center;
459
+ justify-content: space-between;
460
+ gap: 20px;
461
+ width: calc(100% - 48px);
462
+ max-width: 650px;
463
+ z-index: 9999;
464
+ backdrop-filter: blur(20px);
465
+ -webkit-backdrop-filter: blur(20px);
466
+ animation: watt-slide-in-banner 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
467
+ }
468
+
469
+ @keyframes watt-slide-in-banner {
470
+ to { transform: translateX(-50%) translateY(0); }
471
+ }
472
+
473
+ @media (max-width: 576px) {
474
+ .watt-banner-pill {
475
+ flex-direction: column;
476
+ border-radius: 16px;
477
+ padding: 16px;
478
+ text-align: center;
479
+ gap: 12px;
480
+ }
481
+ }
482
+
483
+ /* ==========================================================================
484
+ PAPYR DESIGN ENGINE CORE (papyr-design.css integration)
485
+ Mantra: "Simple inside, Beautiful outside."
486
+ ========================================================================== */
487
+
488
+ :root {
489
+ /* Architectural Design System Defaults (Adaptive Dark Theme Core) */
490
+ --papyr-bg: #030712;
491
+ --papyr-surface: rgba(255, 255, 255, 0.015);
492
+ --papyr-border: rgba(255, 255, 255, 0.06);
493
+ --papyr-text: #f9fafb;
494
+ --papyr-text-muted: #9ca3af;
495
+
496
+ /* Branding & Accent Gradients */
497
+ --papyr-primary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
498
+ --papyr-glow: rgba(99, 102, 241, 0.15);
499
+
500
+ /* Ergonomic Spatial Tokens (Prevents Cluttered Alignments) */
501
+ --papyr-radius-card: 20px;
502
+ --papyr-radius-btn: 12px;
503
+ --papyr-font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
504
+
505
+ /* Apple-Like Cinematic Physics Keyframes */
506
+ --papyr-ease: cubic-bezier(0.16, 1, 0.3, 1);
507
+ --papyr-duration: 0.4s;
508
+ --papyr-transition: all var(--papyr-duration) var(--papyr-ease);
509
+ }
510
+
511
+ /* System Bootstrapper Reset */
512
+ [papyr-root] {
513
+ background-color: var(--papyr-bg);
514
+ color: var(--papyr-text);
515
+ font-family: var(--papyr-font);
516
+ -webkit-font-smoothing: antialiased;
517
+ margin: 0;
518
+ padding: 0;
519
+ }
520
+
521
+ /* ──────────────────────────────────────────────────────────────────────────
522
+ 1. PAPYR CORE CONTAINERS & INTENT BLOCKS
523
+ ────────────────────────────────────────────────────────────────────────── */
524
+
525
+ /* Semantic Layout Engine Flex Hooks */
526
+ .papyr-col, .papyr-row {
527
+ display: flex;
528
+ box-sizing: border-box;
529
+ transition: var(--papyr-transition);
530
+ }
531
+ .papyr-col { flex-direction: column; gap: var(--papyr-gap, 16px); }
532
+ .papyr-row { flex-direction: row; align-items: center; gap: var(--papyr-gap, 16px); }
533
+
534
+ /* The Premium Signature Layer: Glassmorphism Card Engine */
535
+ .papyr-card {
536
+ background: var(--papyr-surface);
537
+ border: 1px solid var(--papyr-border);
538
+ border-radius: var(--papyr-radius-card);
539
+ padding: var(--papyr-pad, 24px);
540
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
541
+ backdrop-filter: blur(var(--papyr-blur, 16px));
542
+ -webkit-backdrop-filter: blur(var(--papyr-blur, 16px));
543
+ transition: var(--papyr-transition);
544
+ }
545
+
546
+ /* Active Interaction Motion State */
547
+ .papyr-card[interactive]:hover, .papyr-card[interactive="true"]:hover {
548
+ transform: translateY(-4px) scale(1.01);
549
+ background: rgba(255, 255, 255, 0.03);
550
+ border-color: rgba(255, 255, 255, 0.12);
551
+ box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 30px var(--papyr-glow);
552
+ }
553
+
554
+ /* ──────────────────────────────────────────────────────────────────────────
555
+ 2. HIGH-END COGNITIVE UI FORMS & BUTTONS
556
+ ────────────────────────────────────────────────────────────────────────── */
557
+
558
+ /* Micro-Interaction Button Design */
559
+ .papyr-btn {
560
+ background: #f9fafb;
561
+ color: #030712;
562
+ border: none;
563
+ border-radius: var(--papyr-radius-btn);
564
+ padding: 12px 24px;
565
+ font-size: 14px;
566
+ font-weight: 600;
567
+ cursor: pointer;
568
+ display: inline-flex;
569
+ align-items: center;
570
+ justify-content: center;
571
+ transition: var(--papyr-transition);
572
+ }
573
+
574
+ .papyr-btn:hover {
575
+ background: #ffffff;
576
+ box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
577
+ transform: scale(1.02);
578
+ }
579
+
580
+ .papyr-btn:active {
581
+ transform: scale(0.98); /* Native Haptic Compression Feedback */
582
+ }
583
+
584
+ /* Primary Accent Mode Override */
585
+ .papyr-btn[intent="primary"] {
586
+ background: var(--papyr-primary);
587
+ color: #ffffff;
588
+ }
589
+ .papyr-btn[intent="primary"]:hover {
590
+ box-shadow: 0 0 25px var(--papyr-glow);
591
+ }
592
+
593
+ /* ──────────────────────────────────────────────────────────────────────────
594
+ 3. CLUTTER-FREE CLEAN TYPOGRAPHY UTILITIES
595
+ ────────────────────────────────────────────────────────────────────────── */
596
+ .papyr-title {
597
+ margin: 0;
598
+ font-size: var(--papyr-fs, 28px);
599
+ font-weight: 700;
600
+ letter-spacing: -0.025em;
601
+ background: linear-gradient(to right, #ffffff, #d1d5db);
602
+ -webkit-background-clip: text;
603
+ -webkit-text-fill-color: transparent;
604
+ }
605
+
606
+ .papyr-muted {
607
+ margin: 0;
608
+ color: var(--papyr-text-muted);
609
+ font-size: var(--papyr-fs, 14px);
610
+ line-height: 1.5;
611
+ }
612
+ `,document.head.appendChild(r),console.log("📄 Papyr UI styling successfully injected.")),"undefined"!=typeof module&&module.exports?module.exports=s:"undefined"!=typeof exports&&(exports.papyr=s)})();
613
+ //# sourceMappingURL=papyr-ui.min.js.map