1(function(){'use strict';function setAttr(el,attrs){if(!el)return;for(const[k,v]of Object.entries(attrs))el.setAttribute(k,v);} 2const QRForgeOwl={_hiding:false,_ready:false,_els:{},init(){const ids=['owlHead','owlPupilL','owlPupilR','owlIrisL','owlIrisR','owlLidL','owlLidR','owlBrowL','owlBrowR','owlWingL','owlWingR'];for(const id of ids){this._els[id]=document.getElementById(id);} 3this._ready=!!this._els.owlHead;return this;},lookAt(ratio){if(!this._ready||this._hiding)return;const{owlHead,owlPupilL,owlPupilR,owlIrisL,owlIrisR}=this._els;const angle=(ratio-0.5)*24;const ex=(ratio-0.5)*7;const ey=1.5;owlHead.style.transform=`rotate(${angle}deg)`;setAttr(owlPupilL,{cx:82+ex,cy:79+ey});setAttr(owlPupilR,{cx:118+ex,cy:79+ey});setAttr(owlIrisL,{cx:82+ex,cy:79+ey});setAttr(owlIrisR,{cx:118+ex,cy:79+ey});},lookCenter(){if(!this._ready)return;const{owlHead,owlPupilL,owlPupilR,owlIrisL,owlIrisR}=this._els;owlHead.style.transform='rotate(0deg)';setAttr(owlPupilL,{cx:82,cy:79});setAttr(owlPupilR,{cx:118,cy:79});setAttr(owlIrisL,{cx:82,cy:79});setAttr(owlIrisR,{cx:118,cy:79});},hideEyes(){if(!this._ready||this._hiding)return;this._hiding=true;const{owlLidL,owlLidR,owlWingL,owlWingR,owlBrowL,owlBrowR,owlHead}=this._els;setAttr(owlLidL,{ry:16});setAttr(owlLidR,{ry:16});owlWingL.style.transform='rotate(-70deg)';owlWingR.style.transform='rotate(70deg)';setAttr(owlBrowL,{y1:60,y2:66});setAttr(owlBrowR,{y1:66,y2:60});owlHead.style.transform='rotate(0deg) translateY(3px)';},showEyes(){if(!this._ready||!this._hiding)return;this._hiding=false;const{owlLidL,owlLidR,owlWingL,owlWingR,owlBrowL,owlBrowR}=this._els;setAttr(owlLidL,{ry:0});setAttr(owlLidR,{ry:0});owlWingL.style.transform='rotate(0deg)';owlWingR.style.transform='rotate(0deg)';setAttr(owlBrowL,{y1:64,y2:64});setAttr(owlBrowR,{y1:64,y2:64});},excited(on){if(!this._ready||this._hiding)return;const{owlPupilL,owlPupilR,owlIrisL,owlIrisR}=this._els;if(on){setAttr(owlPupilL,{r:7});setAttr(owlPupilR,{r:7});setAttr(owlIrisL,{r:12});setAttr(owlIrisR,{r:12});}else{setAttr(owlPupilL,{r:5.5});setAttr(owlPupilR,{r:5.5});setAttr(owlIrisL,{r:10});setAttr(owlIrisR,{r:10});}},_flapping:false,wingFlap(times){if(!this._ready||this._flapping)return;this._flapping=true;const{owlWingL,owlWingR}=this._els;const owl=this;times=times||2;let count=0;function flap(){if(count>=times){owlWingL.style.transform='rotate(0deg)';owlWingR.style.transform='rotate(0deg)';owl._flapping=false;return;} 4owlWingL.style.transform='rotate(-40deg)';owlWingR.style.transform='rotate(40deg)';setTimeout(function(){owlWingL.style.transform='rotate(0deg)';owlWingR.style.transform='rotate(0deg)';count++;setTimeout(flap,120);},180);} 5flap();},headShake(){if(!this._ready)return;const{owlHead}=this._els;const seq=[-10,10,-8,6,-4,0];let i=0;function next(){if(i>=seq.length)return;owlHead.style.transform='rotate('+seq[i]+'deg)';i++;setTimeout(next,100);} 6next();},nod(){if(!this._ready)return;const{owlHead}=this._els;const seq=[3,-2,3,0];let i=0;function next(){if(i>=seq.length)return;owlHead.style.transform='rotate(0deg) translateY('+seq[i]+'px)';i++;setTimeout(next,150);} 7next();},celebrate(){if(!this._ready)return;this.excited(true);this.wingFlap(3);setTimeout(()=>this.nod(),400);setTimeout(()=>this.excited(false),1200);},sad(){if(!this._ready||this._hiding)return;const{owlBrowL,owlBrowR,owlPupilL,owlPupilR,owlIrisL,owlIrisR,owlHead}=this._els;setAttr(owlBrowL,{y1:62,y2:66});setAttr(owlBrowR,{y1:66,y2:62});setAttr(owlPupilL,{r:4,cy:82});setAttr(owlPupilR,{r:4,cy:82});setAttr(owlIrisL,{r:8,cy:82});setAttr(owlIrisR,{r:8,cy:82});owlHead.style.transform='rotate(0deg) translateY(2px)';},resetExpression(){if(!this._ready)return;const{owlBrowL,owlBrowR,owlPupilL,owlPupilR,owlIrisL,owlIrisR,owlHead}=this._els;setAttr(owlBrowL,{y1:64,y2:64});setAttr(owlBrowR,{y1:64,y2:64});setAttr(owlPupilL,{r:5.5,cy:79});setAttr(owlPupilR,{r:5.5,cy:79});setAttr(owlIrisL,{r:10,cy:79});setAttr(owlIrisR,{r:10,cy:79});owlHead.style.transform='rotate(0deg)';},curious(){if(!this._ready||this._hiding)return;const{owlHead,owlIrisL,owlIrisR,owlPupilL,owlPupilR,owlBrowL,owlBrowR}=this._els;owlHead.style.transform='rotate(-12deg)';setAttr(owlIrisL,{r:12});setAttr(owlPupilL,{r:7});setAttr(owlIrisR,{r:9});setAttr(owlPupilR,{r:5});setAttr(owlBrowL,{y1:60,y2:60});setAttr(owlBrowR,{y1:64,y2:64});},bindAuthForm(){if(!this._ready)return;const owl=this;const emailInput=document.getElementById('email');const passInput=document.getElementById('password');
7if(emailInput){emailInput.addEventListener('focus',function(){owl.showEyes();owl.lookAt(Math.min(this.value.length/25,1));});emailInput.addEventListener('input',function(){owl.lookAt(Math.min(this.value.length/25,1));});emailInput.addEventListener('blur',function(){if(document.activeElement!==passInput)owl.lookCenter();});} 8var passFields=[passInput,document.getElementById('confirm_password')];passFields.forEach(function(field){if(!field)return;field.addEventListener('focus',function(){owl.hideEyes();});field.addEventListener('blur',function(){var active=document.activeElement;var stillInPass=passFields.some(function(f){return f===active;});if(!stillInPass){owl.showEyes();owl.lookCenter();}});});const googleBtn=document.querySelector('.auth-google-btn');if(googleBtn){googleBtn.addEventListener('mouseenter',function(){owl.excited(true);});googleBtn.addEventListener('mouseleave',function(){owl.excited(false);});}},_idleTimer:null,_sidebarSpeech:null,blink(){if(!this._ready||this._hiding)return;const{owlLidL,owlLidR}=this._els;setAttr(owlLidL,{ry:16});setAttr(owlLidR,{ry:16});setTimeout(()=>{if(!this._hiding){setAttr(owlLidL,{ry:0.5});setAttr(owlLidR,{ry:0.5});}},180);},_msgTimer:null,showMessage(msg,duration){const el=this._sidebarSpeech||document.getElementById('owlSidebarSpeech');if(!el)return;this._sidebarSpeech=el;if(this._msgTimer){clearTimeout(this._msgTimer);this._msgTimer=null;} 9el.textContent=msg;el.style.maxHeight='80px';el.style.opacity='1';el.style.padding='6px 12px';el.style.marginBottom='6px';if(duration){this._msgTimer=setTimeout(()=>{this.hideMessage();this._msgTimer=null;},duration);}},hideMessage(){const el=this._sidebarSpeech||document.getElementById('owlSidebarSpeech');if(!el)return;el.style.maxHeight='0';el.style.opacity='0';el.style.padding='0';el.style.marginBottom='0';},_walking:false,walk(){if(!this._ready||this._walking)return;const container=document.querySelector('.owl-sidebar .owl-container');if(!container)return;this._walking=true;const goRight=Math.random()>0.5;const dist=25+Math.random()*35;this.lookAt(goRight?0.9:0.1);container.classList.add('owl-walking');container.style.transform='translateX('+(goRight?dist:-dist)+'px)';setTimeout(()=>{this.lookAt(goRight?0.1:0.9);container.style.transform='translateX(0)';setTimeout(()=>{container.classList.remove('owl-walking');this.lookCenter();this._walking=false;},700);},1200);},_idleTick(){if(!this._ready||this._walking)return;const r=Math.random();if(r<0.30){this.blink();}else if(r<0.50){const dir=Math.random();this.lookAt(dir);setTimeout(()=>this.lookCenter(),2000);}else if(r<0.65){this.hideEyes();setTimeout(()=>this.showEyes(),350);}else if(r<0.80){this.walk();}else{this.blink();setTimeout(()=>this.blink(),400);}},startIdle(){if(this._idleTimer)return;const owl=this;function scheduleNext(){const delay=6000+Math.random()*9000;owl._idleTimer=setTimeout(()=>{owl._idleTick();scheduleNext();},delay);} 10setTimeout(()=>owl.blink(),2000);scheduleNext();},stopIdle(){if(this._idleTimer){clearTimeout(this._idleTimer);this._idleTimer=null;}},bindSidebar(pageMsg){if(!this._ready)return;if(pageMsg){this.showMessage(pageMsg);} 11this.startIdle();},_qrBound:false,_qrIdleTimer:null,_qrLastActivity:0,_qrCurrentStep:1,bindQRCreate(msgs){if(!this._ready||this._qrBound||!msgs)return;this._qrBound=true;const owl=this;function resetIdle(){owl._qrLastActivity=Date.now();} 12document.addEventListener('click',resetIdle,{passive:true});document.addEventListener('keydown',resetIdle,{passive:true});resetIdle();owl._qrIdleTimer=setInterval(function(){if(Date.now()-owl._qrLastActivity>30000){owl.showMessage(msgs.idle,6000);owl.blink();owl._qrLastActivity=Date.now();}},10000);var typeMessages={url:msgs.type_url,pdf:msgs.type_pdf,vcard:msgs.type_vcard,wifi:msgs.type_wifi,whatsapp:msgs.type_whatsapp,multiurl:msgs.type_multiurl,location:msgs.type_location,event:msgs.type_event,crypto:msgs.type_crypto,text:msgs.type_text,email:msgs.type_email,phone:msgs.type_phone,sms:msgs.type_sms,social:msgs.type_social,app:msgs.type_app};document.querySelectorAll('.type-tab').forEach(function(tab){tab.addEventListener('click',function(){var type=this.dataset.type;resetIdle();if(this.classList.contains('type-tab-dynamic')&&!window.QR_IS_PREMIUM){owl.showMessage(msgs.pro_only,5000);owl.sad();setTimeout(function(){owl.resetExpression();},2500);return;} 13var msg=typeMessages[type];if(msg){owl.showMessage(msg,5000);owl.resetExpression();owl.wingFlap(2);owl.nod();}});});var urlInput=document.querySelector('input[name="url"]');if(urlInput){urlInput.addEventListener('focus',function(){owl.showMessage(msgs.url_focus,4000);owl.curious();setTimeout(function(){owl.resetExpression();},3000);});urlInput.addEventListener('paste',function(){setTimeout(function(){owl.showMessage(msgs.url_pasted,4000);owl.resetExpression();owl.nod();owl.excited(true);setTimeout(function(){owl.excited(false);},800);},100);});urlInput.addEventListener('blur',function(){var val=this.value.trim();if(val&&!val.match(/^https?:\/\/.+/i)&&val.length>5){owl.showMessage(msgs.url_invalid,5000);owl.headShake();} 14setTimeout(function(){owl.resetExpression();owl.lookCenter();},1000);});} 15var pdfInput=document.querySelector('input[type="file"][accept*="pdf"]');
15if(pdfInput){pdfInput.addEventListener('change',function(){if(this.files&&this.files.length>0){owl.showMessage(msgs.pdf_uploading,8000);owl.curious();}});} 16document.addEventListener('owl:pdf-uploaded',function(){owl.showMessage(msgs.pdf_uploaded,4000);owl.resetExpression();owl.celebrate();});document.addEventListener('owl:step-change',function(e){var step=e.detail?.step;var prevStep=owl._qrCurrentStep;owl._qrCurrentStep=step;resetIdle();if(step===2&&prevStep===1){owl.showMessage(msgs.step2_welcome||msgs.step3_welcome,5000);owl.celebrate();owl.wingFlap(2);owl.excited(true);setTimeout(function(){owl.excited(false);},1200);}else if(step===3&&prevStep===2){owl.showMessage(msgs.downloaded||msgs.step3_welcome,4000);owl.celebrate();}else if(prevStep>step){owl.showMessage(msgs.step_back,4000);owl.resetExpression();owl.nod();}});document.addEventListener('owl:form-empty',function(){owl.showMessage(msgs.form_empty,4000);owl.headShake();owl.sad();setTimeout(function(){owl.resetExpression();},2000);});var tabMsgs={access:msgs.tab_access,schedule:msgs.tab_schedule,targeting:msgs.tab_targeting,tracking:msgs.tab_tracking};document.querySelectorAll('.rule-tab').forEach(function(tab){tab.addEventListener('click',function(){var panel=tab.dataset.ruleTab;if(owl._qrCurrentStep===2&&tabMsgs[panel]){owl.showMessage(tabMsgs[panel],4000);owl.resetExpression();owl.nod();} 17setTimeout(function(){var content=tab.closest('.wizard-content');if(!content)return;var activePanel=content.querySelector('.rule-tab-content.active');var emptyState=activePanel?.querySelector('.rule-tab-empty');if(emptyState&&emptyState.style.display!=='none'){owl.showMessage(msgs.tab_unavailable||'',5000);owl.headShake();}},100);});});document.querySelectorAll('[data-rule-toggle]').forEach(function(header){header.addEventListener('click',function(){var card=header.closest('.rule-card');
17if(card&&card.classList.contains('open')&&msgs.rule_added){owl.wingFlap(1);}});});var dynToggle=document.getElementById('dynamicToggle')||document.getElementById('editDynamicToggle');if(dynToggle){dynToggle.addEventListener('change',function(){if(this.checked){owl.showMessage(msgs.dynamic_on,4000);owl.nod();owl.wingFlap(1);}else if(msgs.dynamic_off){owl.showMessage(msgs.dynamic_off,4000);owl.sad();setTimeout(function(){owl.resetExpression();},2000);}});} 18document.addEventListener('owl:dynamic-limit',function(){owl.showMessage(msgs.dynamic_limit,6000);owl.sad();owl.headShake();setTimeout(function(){owl.resetExpression();},3000);});document.addEventListener('click',function(e){var tpl=e.target.closest('.template-card, .tpl-card');if(tpl){owl.showMessage(msgs.template_selected,4000);owl.nod();owl.excited(true);setTimeout(function(){owl.excited(false);},800);}});var logoInput=document.getElementById('logoInput');if(logoInput){logoInput.addEventListener('change',function(){if(this.files&&this.files.length>0){setTimeout(function(){owl.showMessage(msgs.logo_uploaded,4000);owl.curious();setTimeout(function(){owl.resetExpression();owl.wingFlap(1);},800);},500);}});} 19document.addEventListener('owl:title-empty',function(){owl.showMessage(msgs.title_empty,5000);owl.curious();setTimeout(function(){owl.resetExpression();},3000);});document.addEventListener('owl:contrast-warning',function(){owl.showMessage(msgs.contrast_warning,5000);owl.headShake();owl.hideEyes();setTimeout(function(){owl.showEyes();owl.resetExpression();},1200);});document.querySelectorAll('.download-btn').forEach(function(btn){btn.addEventListener('click',function(){var format=this.dataset.format;if(this.classList.contains('wz-dl-locked')){if(format==='svg')owl.showMessage(msgs.download_svg_locked,5000);else if(format==='pdf')owl.showMessage(msgs.download_pdf_locked,5000);owl.sad();setTimeout(function(){owl.resetExpression();},2500);}else if(format==='png'){owl.showMessage(msgs.download_png,4000);owl.nod();}});});document.addEventListener('owl:downloaded',function(){owl.showMessage(msgs.downloaded,5000);owl.celebrate();setTimeout(function(){owl.showMessage(msgs.create_another,6000);owl.curious();setTimeout(function(){owl.resetExpression();},3000);},4000);});document.addEventListener('owl:saving',function(){owl.showMessage(msgs.saving,3000);owl.blink();});},_analyticsBound:false,bindAnalytics(msgs,opts){if(!this._ready||this._analyticsBound||!msgs)return;this._analyticsBound=true;var owl=this;var isDemo=opts.isDemo||false;var isBasic=opts.isBasic||false;var isQrDetail=opts.isQrDetail||false;var isPro=!isBasic&&!isDemo;var shownTips={};var welcome;if(isDemo){welcome=msgs.demo_welcome;}else if(isQrDetail){welcome=msgs.qr_welcome;}else if(isBasic){welcome=msgs.basic_welcome;}
19else{welcome=msgs.pro_welcome;} 20owl.showMessage(welcome,6000);owl.nod();if(isBasic&&!isDemo&&!isQrDetail){setTimeout(function(){owl.showMessage(msgs.demo_hint,8000);owl.curious();setTimeout(function(){owl.resetExpression();},3000);},9000);} 21if(isDemo){setTimeout(function(){owl.celebrate();},800);var demoTips=[{msg:msgs.demo_tip_scroll,delay:8000},{msg:msgs.demo_tip_map,delay:18000},{msg:msgs.demo_tip_charts,delay:28000},{msg:msgs.demo_tip_upgrade,delay:40000}];demoTips.forEach(function(tip){setTimeout(function(){owl.showMessage(tip.msg,7000);owl.blink();},tip.delay);});} 22if(isPro){setTimeout(function(){var statCards=document.querySelectorAll('.stat-card-value');var totalScans=statCards[0]?parseInt(statCards[0].textContent.replace(/\D/g,''))||0:0;var uniqueScans=statCards[1]?parseInt(statCards[1].textContent.replace(/\D/g,''))||0:0;if(totalScans===0){owl.showMessage(msgs.pro_no_data,6000);owl.curious();setTimeout(function(){owl.resetExpression();},3000);}else if(totalScans>500){owl.showMessage(msgs.pro_high_traffic.replace('{total}',totalScans.toLocaleString()),6000);owl.celebrate();}else if(uniqueScans>0&&totalScans>0){var ratio=Math.round((uniqueScans/totalScans)*100);owl.showMessage(msgs.pro_unique_ratio.replace('{ratio}',ratio),6000);owl.excited(true);setTimeout(function(){owl.excited(false);},1500);}},4000);} 23if(isPro){setTimeout(function(){var firstCountryRow=document.querySelector('.analytics-blur-wrapper:not(.analytics-locked) .table tbody tr:first-child .td-title');if(firstCountryRow){var country=firstCountryRow.textContent.trim();owl.showMessage(msgs.pro_top_country.replace('{country}',country),6000);owl.wingFlap(2);}},16000);} 24document.querySelectorAll('.analytics-pill').forEach(function(pill){pill.addEventListener('click',function(e){if(this.classList.contains('analytics-pill-locked')){e.preventDefault();owl.showMessage(msgs.period_locked,5000);owl.sad();owl.headShake();setTimeout(function(){owl.resetExpression();},2500);}else if(isPro){var days=this.textContent.trim();owl.showMessage(msgs.pro_period_change.replace('{days}',days),4000);owl.nod();}});});document.addEventListener('click',function(e){var overlay=e.target.closest('.analytics-blur-overlay');if(overlay){var card=overlay.closest('.analytics-blur-wrapper');if(!card)return;var title=card.querySelector('.card-header h3');var section=title?title.textContent.trim():'';owl.showMessage(msgs.locked_click.replace('{section}',section),6000);owl.curious();setTimeout(function(){owl.resetExpression();},3000);}});var tipSections=[{selector:'#scanMap',lockedKey:'tip_map',proKey:'pro_tip_map',shown:false},{selector:'#deviceTypeChart',lockedKey:'tip_charts',proKey:'pro_tip_charts',shown:false},{selector:'.referrer-row, .referrer-content',lockedKey:'tip_referrers',proKey:'pro_tip_referrers',shown:false}];function checkScrollTips(){var vh=window.innerHeight;tipSections.forEach(function(s){if(s.shown||shownTips[s.lockedKey])return;var el=document.querySelector(s.selector);if(!el)return;var rect=el.getBoundingClientRect();if(rect.top<vh*0.8&&rect.bottom>0){s.shown=true;shownTips[s.lockedKey]=true;var card=el.closest('.analytics-blur-wrapper');var isLocked=card&&card.classList.contains('analytics-locked');var key=(isPro&&!isLocked)?s.proKey:s.lockedKey;if(msgs[key]){owl.showMessage(msgs[key],5000);owl.blink();}}});} 25var scrollTimer=null;window.addEventListener('scroll',function(){if(scrollTimer)return;scrollTimer=setTimeout(function(){scrollTimer=null;checkScrollTips();},300);},{passive:true});var lastActivity=Date.now();var pool=isPro?[msgs.pro_idle_1,msgs.pro_idle_2,msgs.pro_idle_3]:[msgs.idle_1,msgs.idle_2,msgs.idle_3];var idleMsgs=pool.filter(Boolean);var idleIdx=0;function resetActivity(){lastActivity=Date.now();} 26document.addEventListener('click',resetActivity,{passive:true});document.addEventListener('scroll',resetActivity,{passive:true});document.addEventListener('keydown',resetActivity,{passive:true});setInterval(function(){if(Date.now()-lastActivity>30000&&idleMsgs.length>0){owl.showMessage(idleMsgs[idleIdx%idleMsgs.length],6000);owl.blink();idleIdx++;lastActivity=Date.now();}},10000);},_homeBound:false,_homeIdleTimer:null,_homeLastActivity:0,_homeSpeechEl:null,showH
26omeMessage(msg,duration){var el=this._homeSpeechEl||document.getElementById('owlHomeSpeech');if(!el)return;this._homeSpeechEl=el;if(this._homeHideTimer){clearTimeout(this._homeHideTimer);this._homeHideTimer=null;} 27el.textContent=msg;el.style.maxHeight='80px';el.style.opacity='1';el.style.padding='8px 14px';el.style.marginBottom='8px';if(duration){var self=this;this._homeHideTimer=setTimeout(function(){el.style.maxHeight='0';el.style.opacity='0';el.style.padding='0';el.style.marginBottom='0';self._homeHideTimer=null;},duration);}},_homeHideTimer:null,bindHomepage(msgs,isLoggedIn){if(!this._ready||this._homeBound||!msgs)return;this._homeBound=true;var owl=this;var welcomeMsg=isLoggedIn?msgs.user_welcome:msgs.guest_welcome;setTimeout(function(){owl.showHomeMessage(welcomeMsg,6000);owl.wingFlap(2);},1500);function resetIdle(){owl._homeLastActivity=Date.now();} 28document.addEventListener('click',resetIdle,{passive:true});document.addEventListener('keydown',resetIdle,{passive:true});resetIdle();owl._homeIdleTimer=setInterval(function(){if(Date.now()-owl._homeLastActivity>30000){var idleMsg=isLoggedIn?msgs.user_idle:msgs.guest_idle;owl.showHomeMessage(idleMsg,6000);owl.blink();owl._homeLastActivity=Date.now();}},10000);var typeMessages={url:msgs.type_url,pdf:msgs.type_pdf,vcard:msgs.type_vcard,wifi:msgs.type_wifi,whatsapp:msgs.type_whatsapp,multiurl:msgs.type_multiurl,location:msgs.type_location,event:msgs.type_event,crypto:msgs.type_crypto,text:msgs.type_text,email:msgs.type_email,phone:msgs.type_phone,sms:msgs.type_sms,social:msgs.type_social,app:msgs.type_app};document.querySelectorAll('.type-tab').forEach(function(tab){tab.addEventListener('click',function(){var type=this.dataset.type;resetIdle();if(!isLoggedIn&&this.querySelector('.tab-pro-badge')){owl.showHomeMessage(msgs.guest_pro_type,5000);owl.curious();setTimeout(function(){owl.resetExpression();},3000);return;} 29var msg=typeMessages[type];if(msg){owl.showHomeMessage(msg,5000);owl.resetExpression();owl.wingFlap(2);owl.nod();}});});var urlInput=document.querySelector('.generator-left input[name="url"]');if(urlInput){urlInput.addEventListener('paste',function(){setTimeout(function(){var readyMsg=isLoggedIn?msgs.user_qr_ready:msgs.guest_qr_ready;owl.showHomeMessage(readyMsg,5000);owl.nod();owl.excited(true);setTimeout(function(){owl.excited(false);},800);},300);});} 30var trackBtn=document.getElementById('trackScansBtn');if(trackBtn){trackBtn.addEventListener('click',function(){if(!isLoggedIn){owl.showHomeMessage(msgs.guest_dynamic,5000);owl.curious();setTimeout(function(){owl.resetExpression();},3000);}else{owl.showHomeMessage(msgs.type_url,4000);owl.nod();}});} 31document.addEventListener('owl:downloaded',function(){var dlMsg=isLoggedIn?msgs.user_downloaded:msgs.guest_downloaded;owl.showHomeMessage(dlMsg,5000);owl.celebrate();if(!isLoggedIn){setTimeout(function(){owl.showHomeMessage(msgs.guest_signup_nudge,8000);owl.curious();setTimeout(function(){owl.resetExpression();},4000);},6000);}});document.addEventListener('owl:logo-locked',function(){owl.showHomeMessage(msgs.guest_logo_locked,5000);owl.sad();setTimeout(function(){owl.resetExpression();},2500);});document.addEventListener('owl:format-locked',function(){var fmtMsg=isLoggedIn?msgs.user_format_locked:msgs.guest_format_locked;owl.showHomeMessage(fmtMsg,5000);owl.sad();setTimeout(function(){owl.resetExpression();},2500);});document.addEventListener('click',function(e){if(e.target.closest('.carousel-thumb')){owl.showHomeMessage(msgs.template_selected||'',3000);owl.nod();}});document.addEventListener('owl:modal-open',function(){owl.showHomeMessage(msgs.modal_open,5000);owl.excited(true);owl.wingFlap(2);setTimeout(function(){owl.excited(false);},1000);});document.addEventListener('owl:modal-done',function(){owl.showHomeMessage(msgs.modal_done,5000);owl.celebrate();});var _lastModalMsg=0;function modalMsg(msg,duration,anim){var now=Date.now();if(now-_lastModalMsg<2000)return;_lastModalMsg=now;owl.showHomeMessage(msg,duration);if(anim)anim();} 32var _colorDebounce=null;document.addEventListener('input',function(e){if(!e.target.closest('#customizeModal')||!e.target.classList.contains('color-picker'))return;resetIdle();if(_colorDebounce)clearTimeout(_colorDebounce);_colorDebounce=setTimeout(function(){modalMsg(msgs.modal_color_change,3000,function(){owl.nod();});},500);});document.addEventListener('click',function(e){if(!e.target.closest('#customizeModal'))return;resetIdle();var tplBtn=e.target.closest('#templatePanel [data-modal-tpl]');if(tplBtn){var slug=tplBtn.dataset.modalTpl;var tplMsg=(msgs.tpl&&msgs.tpl[slug])||'';if(!tplMsg)return;modalMsg(tplMsg,5000,function(){owl.excited(true);owl.wingFlap(2);setTimeout(function(){owl.excited(false);},1000);});return;} 33var frameBtn=e.target.closest('#framesPanel [data-design="frame"]');if(frameBtn){var frameType=frameBtn.dataset.value;var frameMsg=(msgs.frame&&msgs.frame[frameType])||'';if(!frameMsg)return;modalMsg(frameMsg,4000,function(){if(frameType==='none'){owl.blink();} 34else if(frameType==='circle'){owl.curious();setTimeout(function(){owl.resetExpression();},2000);} 35else if(frameType==='focus'){owl.excited(true);owl.nod();setTimeout(function(){owl.excited(false);},2000);} 36else{owl.wingFlap(1);owl.nod();}});return;} 37var patBtn=e.target.closest('#stylePanel .pattern-option');if(patBtn){var patKey=patBtn.dataset.value;var patMsg=(msgs.pat&&msgs.pat[patKey])||'';if(!patMsg)return;modalMsg(patMsg,4000,function(){if(patKey==='dots'||patKey==='smooth'){owl.curious();setTimeout(function(){owl.resetExpression();},2000);} 38else if(patKey==='sharp'){owl.excited(true);setTimeout(function(){owl.excited(false);},1000);} 39else{owl.nod();}});return;} 40var cornerBtn=e.target.closest('#stylePanel .corner-option');if(cornerBtn){var cornerVal=cornerBtn.dataset.value;var cornerMsg=(msgs.corner&&msgs.corner[cornerVal])||'';if(!cornerMsg)return;modalMsg(cornerMsg,4000,function(){if(cornerVal==='hybrid'){owl.excited(true);owl.wingFlap(2);setTimeout(function(){owl.excited(false);},1000);} 41else if(cornerVal==='dot'){owl.curious();setTimeout(function(){owl.resetExpression();},2000);} 42else{owl.nod();}});return;} 43var logoBtn=e.target.closest('#logoPanel .logo-preset-btn');if(logoBtn){modalMsg(msgs.modal_logo_add,4000,function(){owl.nod();owl.wingFlap(1);});return;} 44var uploadBtn=e.target.closest('#logoPanel #logoUploadBtn');if(uploadBtn){modalMsg(msgs.modal_logo_add,3000,function(){owl.curious();});return;}});
44var gradToggle=document.getElementById('gradientToggle');if(gradToggle){gradToggle.addEventListener('change',function(){if(this.checked){modalMsg(msgs.modal_gradient_on,3000,function(){owl.curious();setTimeout(function(){owl.resetExpression();},2000);});}});} 45var modalLogoInput=document.getElementById('logoInput');if(modalLogoInput){modalLogoInput.addEventListener('change',function(){if(this.files&&this.files.length>0){setTimeout(function(){modalMsg(msgs.modal_logo_add,4000,function(){owl.nod();owl.wingFlap(1);});},500);}});} 46var marginSlider=document.getElementById('modalOuterMargin');var _marginDebounce=null;if(marginSlider){marginSlider.addEventListener('input',function(){if(_marginDebounce)clearTimeout(_marginDebounce);_marginDebounce=setTimeout(function(){modalMsg(msgs.modal_margin_change,3000,function(){owl.blink();});},600);});}},unbindQRCreate(){if(this._qrIdleTimer){clearInterval(this._qrIdleTimer);this._qrIdleTimer=null;} 47this._qrBound=false;},bindLinkPage(msgs,opts){if(!this._ready||this._lpBound||!msgs)return;this._lpBound=true;var owl=this;var isNew=opts&&opts.isNew;setTimeout(function(){owl.showMessage(isNew?msgs.welcome_create:msgs.welcome_edit,5000);owl.wingFlap(2);},1500);owl._lpLastActivity=Date.now();function resetIdle(){owl._lpLastActivity=Date.now();} 48document.addEventListener('click',resetIdle,{passive:true});document.addEventListener('keydown',resetIdle,{passive:true});owl._lpIdleTimer=setInterval(function(){if(Date.now()-owl._lpLastActivity>35000){owl.showMessage(msgs.idle,6000);owl.blink();owl._lpLastActivity=Date.now();}},10000);document.querySelectorAll('.lpe-template-card').forEach(function(card){card.addEventListener('click',function(){resetIdle();owl.showMessage(msgs.template_selected,4000);owl.nod();owl.excited(true);setTimeout(function(){owl.excited(false);},800);});});document.querySelectorAll('.lpe-theme-card').forEach(function(card){card.addEventListener('click',function(){resetIdle();owl.showMessage(msgs.theme_changed,3500);owl.resetExpression();owl.wingFlap(1);});});var blockList=document.querySelector('.lpe-block-list');if(blockList){var blockObserver=new MutationObserver(function(mutations){mutations.forEach(function(m){if(m.addedNodes.length>0){resetIdle();owl.showMessage(msgs.block_added,3000);owl.nod();} 49if(m.removedNodes.length>0){owl.showMessage(msgs.block_deleted,3000);}});});blockObserver.observe(blockList,{childList:true});} 50var saveBtn=document.querySelector('.lpe-save-btn');if(saveBtn){saveBtn.addEventListener('click',function(){resetIdle();setTimeout(function(){owl.showMessage(msgs.saved,3500);owl.excited(true);setTimeout(function(){owl.excited(false);},1000);},1500);});} 51var publishToggle=document.getElementById('lpPublishToggle');if(publishToggle){publishToggle.addEventListener('change',function(){resetIdle();owl.showMessage(this.checked?msgs.published:msgs.unpublished,4000);if(this.checked){owl.wingFlap(2);}});} 52var seoTab=document.querySelector('.lpe-tab[data-lpe-tab="seo"]');if(seoTab){seoTab.addEventListener('click',function(){resetIdle();owl.showMessage(msgs.seo_tip,5000);owl.curious();setTimeout(function(){owl.resetExpression();},3000);});} 53var avatarWrap=document.querySelector('.lpe-avatar-wrap');if(avatarWrap){avatarWrap.addEventListener('change',function(){resetIdle();owl.showMessage(msgs.avatar_uploaded,3500);owl.nod();});}},unbindLinkPage(){if(this._lpIdleTimer){clearInterval(this._lpIdleTimer);this._lpIdleTimer=null;} 54this._lpBound=false;},_chatOpen:false,_chatBusy:false,toggleChat(){if(this._minimized){this._restoreFromMinimize();}else if(this._chatOpen){this.closeChat();}else{this.openChat();}},openChat(){const win=document.getElementById('owlFloatChat');if(!win)return;this._chatOpen=true;var saved={};try{saved=JSON.parse(localStorage.getItem('owl_chat_pos')||'{}');}catch(e){} 55var isMobile=window.innerWidth<=768;if(!isMobile){win.style.left=(saved.x||280)+'px';win.style.top=(saved.y||Math.max(60,window.innerHeight-560))+'px';if(saved.w)win.style.width=saved.w+'px';if(saved.h)win.style.height=saved.h+'px';} 56win.classList.add('owl-float-open');win.classList.remove('owl-float-minimized');try{localStorage.setItem('owl_chat_state_'+(window.__userId||0),'open');}catch(e){} 57var avatar=document.getElementById('owlFloatAvatar');if(avatar&&!avatar.querySelector('.owl-svg')){var owlSvg=document.querySelector('.owl-sidebar .owl-svg');if(owlSvg){var clone=owlSvg.cloneNode(true);clone.style.width='24px';clone.style.height='24px';avatar.appendChild(clone);}} 58this.hideMessage();this.excited(true);setTimeout(()=>{this.excited(false);document.getElementById('owlChatInput')?.focus();},400);this._loadChatHistory();this._initDraggable();this._initResize();},closeChat(){var win=document.getElementById('owlFloatChat');if(!win)return;win.classList.remove('owl-float-open','owl-float-minimized');this._chatOpen=false;try{localStorage.setItem('owl_chat_state_'+(window.__userId||0),'closed');}catch(e){}},_minimized:false,minimizeChat(){var win=document.getElementById('owlFloatChat');if(!win)return;if(!this._minimized){var owlEl=document.querySelector('.owl-sidebar .owl-container');
58if(owlEl){var owlRect=owlEl.getBoundingClientRect();var winRect=win.getBoundingClientRect();var dx=owlRect.left+owlRect.width/2-(winRect.left+winRect.width/2);var dy=owlRect.top+owlRect.height/2-(winRect.top+winRect.height/2);win.style.transition='transform 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease';win.style.transform='translate('+dx+'px,'+dy+'px) scale(0.05)';win.style.opacity='0';setTimeout(function(){win.style.display='none';win.style.transition='';win.style.transform='';win.style.opacity='';},400);}else{win.style.display='none';} 59this._minimized=true;this._showChatBadge(true);try{localStorage.setItem('owl_chat_state_'+(window.__userId||0),'minimized');}catch(e){}}else{this._restoreFromMinimize();}},_restoreFromMinimize(){var win=document.getElementById('owlFloatChat');if(!win)return;var saved={};try{saved=JSON.parse(localStorage.getItem('owl_chat_pos')||'{}');}catch(e){} 60if(window.innerWidth>768){win.style.left=(saved.x||280)+'px';win.style.top=(saved.y||Math.max(60,window.innerHeight-560))+'px';} 61var owlEl=document.querySelector('.owl-sidebar .owl-container');if(owlEl){var owlRect=owlEl.getBoundingClientRect();var targetX=saved.x||280;var targetY=saved.y||Math.max(60,window.innerHeight-560);var dx=owlRect.left-targetX;var dy=owlRect.top-targetY;win.style.transform='translate('+dx+'px,'+dy+'px) scale(0.05)';win.style.opacity='0';win.style.display='flex';win.offsetHeight;win.style.transition='transform 0.45s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease';win.style.transform='translate(0,0) scale(1)';win.style.opacity='1';setTimeout(function(){win.style.transition='';win.style.transform='';win.style.opacity='';},500);}else{win.style.display='flex';} 62this._minimized=false;this._showChatBadge(false);try{localStorage.setItem('owl_chat_state_'+(window.__userId||0),'open');}catch(e){} 63setTimeout(function(){var input=document.getElementById('owlChatInput');if(input)input.focus();},500);},_showChatBadge(show){var owlEl=document.querySelector('.owl-sidebar .owl-container');if(!owlEl)return;var existing=owlEl.querySelector('.owl-chat-badge');if(show){if(!existing){var badge=document.createElement('div');badge.className='owl-chat-badge';badge.innerHTML='<svg width="10" height="10" viewBox="0 0 24 24" fill="#fff"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>';owlEl.appendChild(badge);}}else{if(existing)existing.remove();}},_savePosition(){var win=document.getElementById('owlFloatChat');if(!win||window.innerWidth<=768)return;try{localStorage.setItem('owl_chat_pos',JSON.stringify({x:parseInt(win.style.left)||280,y:parseInt(win.style.top)||200,w:win.offsetWidth,h:win.offsetHeight}));}catch(e){}},_dragInited:false,_initDraggable(){if(this._dragInited||window.innerWidth<=768)return;this._dragInited=true;var win=document.getElementById('owlFloatChat');var header=document.getElementById('owlFloatHeader');if(!win||!header)return;var owl=this;var startX,startY,origX,origY;header.addEventListener('mousedown',function(e){if(e.target.closest('.owl-float-btn'))return;e.preventDefault();startX=e.clientX;startY=e.clientY;origX=parseInt(win.style.left)||win.offsetLeft;origY=parseInt(win.style.top)||win.offsetTop;win.classList.add('owl-float-dragging');function onMove(e){win.style.left=Math.max(0,origX+e.clientX-startX)+'px';win.style.top=Math.max(0,origY+e.clientY-startY)+'px';} 64function onUp(){document.removeEventListener('mousemove',onMove);document.removeEventListener('mouseup',onUp);win.classList.remove('owl-float-dragging');owl._savePosition();} 65document.addEventListener('mousemove',onMove);document.addEventListener('mouseup',onUp);});},_resizeInited:false,_initResize(){if(this._resizeInited||window.innerWidth<=768)return;this._resizeInited=true;var win=document.getElementById('owlFloatChat');if(!win)return;var owl=this;var startX,startY,origW,origH;var handle=win;win.addEventListener('mousedown',function(e){var rect=win.getBoundingClientRect();if(e.clientX<rect.right-16||e.clientY<rect.bottom-16)return;e.preventDefault();startX=e.clientX;startY=e.clientY;origW=win.offsetWidth;origH=win.offsetHeight;function onMove(e){win.style.width=Math.max(300,origW+e.clientX-startX)+'px';win.style.height=Math.max(350,origH+e.clientY-startY)+'px';} 66function onUp(){document.removeEventListener('mousemove',onMove);document.removeEventListener('mouseup',onUp);owl._savePosition();} 67document.addEventListener('mousemove',onMove);document.addEventListener('mouseup',onUp);});},_chatStorageKey:'owl_chat_'+(window.__userId||0),_saveChatHistory(){const container=document.getElementById('owlChatMessages');if(!container)return;const msgs=[];container.querySelectorAll('.owl-chat-msg').forEach(function(el){var type=el.classList.contains('owl-chat-msg-user')?'user':'owl';msgs.push({text:el.textContent,type:type});});var toSave=msgs.slice(-30);try{localStorage.setItem(this._chatStorageKey,JSON.stringify(toSave));}catch(e){}},_loadChatHistory(){var container=document.getElementById('owlChatMessages');if(!container||container.children.length>0)return;try{var saved=JSON.parse(localStorage.getItem(this._chatStorageKey)||'[]');var self=this;saved.forEach(function(m){self._addChatMsgDom(m.text,m.type);});container.scrollTop=container.scrollHeight;}catch(e){}},_addChatMsgDom(text,type){var container=document.getElementById('owlChatMessages');if(!container)return;var div=document.createElement('div');div.className='owl-chat-msg owl-chat-msg-'+type;if(type==='owl'){var html=text.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');html=html.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" class="owl-chat-link">$1</a>');html=html.replace(/\*\*([^*]+)\*\*/g,'<strong>$1</strong>');div.innerHTML=html;}else{div.textContent=text;} 68container.appendChild(div);return div;},async clearChat(){var self=this;var i18n=window._owlI18n||{};var confirmMsg=i18n.clear_confirm||'Clear chat history?';var ok;if(window.QRForge&&typeof window.QRForge.confirm==='function'){ok=await window.QRForge.confirm(confirmMsg,{title:i18n.clear||'Clear chat',type:'danger',confirmText:i18n.clear||'Clear',cancelText:i18n.cancel||'Cancel',});}else{ok=window.confirm(confirmMsg);} 69if(!ok)return;var container=document.getElementById('owlChatMessages');if(container)container.innerHTML='';try{localStorage.removeItem(self._chatStorageKey);}catch(e){} 70var hint=i18n.cleared||'Chat cleared â start fresh!';this._addChatMsgDom(hint,'owl');},_addChatDraftCard(draft){var container=document.getElementById('owlChatMessages');if(!container)return;var card=document.createElement('div');card.className='owl-chat-draft-card';var typeLabels=(window._owlI18n&&window._owlI18n.draft_type_labels)||{};var typeLabel=typeLabels[draft.type]||draft.type;var summary=draft.summary?String(draft.summary):'';if(summary.length>60)summary=summary.slice(0,57)+'â¦';var title=draft.title?String(draft.title):(window._owlI18n?.draft_title_fallback||'QR Draft');var ctaLabel=window._owlI18n?.draft_cta||'TaslaÄı Aç';var lang=document.documentElement.lang||'';var basePath=lang&&lang!=='en'?'/'+lang:'';var href=basePath+draft.url;var esc=function(s){return String(s).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"');};card.innerHTML='<div class="owl-chat-draft-header">'+'<span class="owl-chat-draft-icon" aria-hidden="true">'+'<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7"/><rect x="14" y="3" width="7" height="7"/><rect x="3" y="14" width="7" height="7"/><path d="M14 14h3v3h-3z"/><path d="M20 14v3"/><path d="M14 20h3"/></svg>'+'</span>'+'<div class="owl-chat-draft-meta">'+'<div class="owl-chat-draft-title">'+esc(title)+'</div>'+'<div class="owl-chat-draft-type">'+esc(typeLabel)+(summary?' · '+esc(summary):'')+'</div>'+'</div>'+'</div>'+'<a class="owl-chat-draft-cta" href="'+esc(href)+'">'+esc(ctaLabel)+'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="M13 5l7 7-7 7"/></svg>'+'</a>';container.appendChild(card);container.scrollTop=container.scrollHeight;},addChatMsg(text,type){var div=this._addChatMsgDom(text,type);var container=document.getElementById('owlChatMessages');if(container)container.scrollTop=container.scrollHeight;if(type!=='thinking')this._saveChatHistory();return div;},async sendChatMessage(){if(this._chatBusy)return;var input=document.getElementById('owlChatInput');var msg=input?.value?.trim();if(!msg)return;input.value='';this.addChatMsg(msg,'user');this._chatBusy=true;this.hideEyes();var thinkingEl=this._addChatMsgDom(window._owlI18n?.thinking||'Thinking...','thinking');var container=document.getElementById('owlChatMessages');if(container)container.scrollTop=container.scrollHeight;var lang=document.documentElement.lang||'';var basePath=lang&&lang!=='en'?'/'+lang:'';var csrf=document.querySelector('meta[name="csrf-token"]')?.content||'';var page=window.location.pathname.replace(/^\/(tr|en|de|es|ru)/,'')||'/dashboard';var history=[];try{var saved=JSON.parse(localStorage.getItem(this._chatStorageKey)||'[]');
70saved.slice(-10).forEach(function(m){history.push({role:m.type==='user'?'user':'assistant',content:m.text});});}catch(e){} 71var body={message:msg,page:page,history:history};try{var qrf=window.QRForge;if(qrf&&typeof qrf.getDesign==='function'&&(page.indexOf('/dashboard/qrcodes/create')!==-1||/\/dashboard\/qrcodes\/\d+\/edit/.test(page))){var d=qrf.getDesign();if(d)body.qr_design=d;if(typeof qrf.getType==='function')body.qr_type=qrf.getType();}}catch(e){} 72try{var res=await fetch(basePath+'/api/owl-chat',{method:'POST',headers:{'Content-Type':'application/json','X-CSRF-TOKEN':csrf},body:JSON.stringify(body),});var data=await res.json();thinkingEl?.remove();this.showEyes();this.excited(true);setTimeout(()=>this.excited(false),800);if(data.success){if(data.design&&window.QRForge&&typeof window.QRForge.applyDesign==='function'){try{window.QRForge.applyDesign(data.design);}catch(e){}} 73this.addChatMsg(data.message,'owl');if(data.draft&&data.draft.url){this._addChatDraftCard(data.draft);} 74var rem=document.getElementById('owlChatRemaining');if(rem&&data.remaining!==undefined){if(data.remaining===-1){rem.textContent='';}else{rem.textContent=data.remaining+' '+(window._owlI18n?.remaining||'left');}}}else{this.addChatMsg(data.error||'Error','owl');}}catch(e){thinkingEl?.remove();this.showEyes();this.addChatMsg(window._owlI18n?.error||'Error','owl');} 75this._chatBusy=false;}};function boot(){QRForgeOwl.init();if(QRForgeOwl._ready&&document.querySelector('.auth-section')){QRForgeOwl.bindAuthForm();} 76var closeBtn=document.getElementById('owlFloatClose');var minBtn=document.getElementById('owlFloatMinimize');var sendBtn=document.getElementById('owlChatSend');var chatInput=document.getElementById('owlChatInput');if(document.getElementById('owlFloatChat')){try{var chatState=localStorage.getItem('owl_chat_state_'+(window.__userId||0));if(chatState==='open'){QRForgeOwl.openChat();}else if(chatState==='minimized'){QRForgeOwl.openChat();var w=document.getElementById('owlFloatChat');if(w){w.style.display='none';} 77QRForgeOwl._minimized=true;QRForgeOwl._chatOpen=true;QRForgeOwl._showChatBadge(true);}}catch(e){}} 78var sidebarOwl=document.querySelector('.owl-sidebar .owl-container');if(sidebarOwl){sidebarOwl.addEventListener('click',function(){QRForgeOwl.toggleChat();});} 79if(closeBtn)closeBtn.addEventListener('click',function(){QRForgeOwl.closeChat();});if(minBtn)minBtn.addEventListener('click',function(){QRForgeOwl.minimizeChat();});if(sendBtn)sendBtn.addEventListener('click',function(){QRForgeOwl.sendChatMessage();});if(chatInput){chatInput.addEventListener('keydown',function(e){if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();QRForgeOwl.sendChatMessage();}});}} 80if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',boot);}else{boot();} 81window.QRForgeOwl=QRForgeOwl;})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.